diff --git a/manager/job/preheat.go b/manager/job/preheat.go index e0c1b68c8b6..fc58a89e961 100644 --- a/manager/job/preheat.go +++ b/manager/job/preheat.go @@ -125,7 +125,7 @@ func (p *preheat) CreatePreheat(ctx context.Context, schedulers []models.Schedul }, } default: - return nil, errors.New("unknow preheat type") + return nil, errors.New("unknown preheat type") } return p.createGroupJob(ctx, files, queues) @@ -202,7 +202,7 @@ func (p *preheat) getLayers(ctx context.Context, url, tag, filter string, header } } - layers, err := p.parseLayers(resp, url, tag, filter, header, image) + layers, err := p.parseLayers(resp, tag, filter, header, image) if err != nil { return nil, err } @@ -237,7 +237,7 @@ func (p *preheat) getManifests(ctx context.Context, url string, header http.Head } // parseLayers parses layers of image. -func (p *preheat) parseLayers(resp *http.Response, url, tag, filter string, header http.Header, image *preheatImage) ([]internaljob.PreheatRequest, error) { +func (p *preheat) parseLayers(resp *http.Response, tag, filter string, header http.Header, image *preheatImage) ([]internaljob.PreheatRequest, error) { body, err := io.ReadAll(resp.Body) if err != nil { return nil, err @@ -319,9 +319,9 @@ func authURL(wwwAuth []string) string { polished = append(polished, strings.ReplaceAll(it, "\"", "")) } - fileds := strings.Split(polished[0], ",") - host := strings.Split(fileds[0], "=")[1] - query := strings.Join(fileds[1:], "&") + fields := strings.Split(polished[0], ",") + host := strings.Split(fields[0], "=")[1] + query := strings.Join(fields[1:], "&") return fmt.Sprintf("%s?%s", host, query) } diff --git a/manager/job/sync_peers.go b/manager/job/sync_peers.go index 4f987f076b3..033571022e3 100644 --- a/manager/job/sync_peers.go +++ b/manager/job/sync_peers.go @@ -41,7 +41,7 @@ type SyncPeers interface { // Run sync peers. Run(context.Context) error - // Started sync peers server. + // Serve started sync peers server. Serve() // Stop sync peers server. @@ -108,7 +108,7 @@ func (s *syncPeers) Run(ctx context.Context) error { return nil } -// Started sync peers server. +// Serve started sync peers server. func (s *syncPeers) Serve() { tick := time.NewTicker(s.config.Job.SyncPeers.Interval) for {