Skip to content

Commit

Permalink
chore(manager/job): cleanup and fix typo (#2799)
Browse files Browse the repository at this point in the history
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
  • Loading branch information
sashamelentyev authored Oct 16, 2023
1 parent e25e35a commit c97909a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions manager/job/preheat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions manager/job/sync_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c97909a

Please sign in to comment.