c8d/push: Rename jobs to avoid shadowing type

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-03-31 15:57:00 +02:00
parent e1dd9c0396
commit 027f70562e
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -64,8 +64,8 @@ func (i *ImageService) PushImage(ctx context.Context, targetRef reference.Named,
resolver, tracker := i.newResolverFromAuthConfig(authConfig) resolver, tracker := i.newResolverFromAuthConfig(authConfig)
progress := pushProgress{Tracker: tracker} progress := pushProgress{Tracker: tracker}
jobs := newJobs() jobsQueue := newJobs()
finishProgress := jobs.showProgress(ctx, out, combinedProgress([]progressUpdater{ finishProgress := jobsQueue.showProgress(ctx, out, combinedProgress([]progressUpdater{
&progress, &progress,
pullProgress{ShowExists: false, Store: store}, pullProgress{ShowExists: false, Store: store},
})) }))
@ -73,7 +73,7 @@ func (i *ImageService) PushImage(ctx context.Context, targetRef reference.Named,
var limiter *semaphore.Weighted = nil // TODO: Respect max concurrent downloads/uploads var limiter *semaphore.Weighted = nil // TODO: Respect max concurrent downloads/uploads
mountableBlobs, err := findMissingMountable(ctx, store, jobs, target, targetRef, limiter) mountableBlobs, err := findMissingMountable(ctx, store, jobsQueue, target, targetRef, limiter)
if err != nil { if err != nil {
return err return err
} }
@ -99,10 +99,10 @@ func (i *ImageService) PushImage(ctx context.Context, targetRef reference.Named,
return nil, err return nil, err
} }
for _, c := range children { for _, c := range children {
jobs.Add(c) jobsQueue.Add(c)
} }
jobs.Add(desc) jobsQueue.Add(desc)
return nil, nil return nil, nil
}, },
@ -146,7 +146,7 @@ func (i *ImageService) PushImage(ctx context.Context, targetRef reference.Named,
// findMissingMountable will walk the target descriptor recursively and return // findMissingMountable will walk the target descriptor recursively and return
// missing contents with their distribution source which could potentially // missing contents with their distribution source which could potentially
// be cross-repo mounted. // be cross-repo mounted.
func findMissingMountable(ctx context.Context, store content.Store, jobs *jobs, func findMissingMountable(ctx context.Context, store content.Store, queue *jobs,
target ocispec.Descriptor, targetRef reference.Named, limiter *semaphore.Weighted, target ocispec.Descriptor, targetRef reference.Named, limiter *semaphore.Weighted,
) (map[digest.Digest]distributionSource, error) { ) (map[digest.Digest]distributionSource, error) {
mountableBlobs := map[digest.Digest]distributionSource{} mountableBlobs := map[digest.Digest]distributionSource{}
@ -173,7 +173,7 @@ func findMissingMountable(ctx context.Context, store content.Store, jobs *jobs,
mutex.Lock() mutex.Lock()
mountableBlobs[desc.Digest] = source mountableBlobs[desc.Digest] = source
mutex.Unlock() mutex.Unlock()
jobs.Add(desc) queue.Add(desc)
break break
} }
} }