Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.0 backport] Don't return an error if the lease is not found #46300

Merged
merged 1 commit into from Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions daemon/images/image.go
Expand Up @@ -54,10 +54,13 @@ func (i *ImageService) PrepareSnapshot(ctx context.Context, id string, image str
func (i *ImageService) manifestMatchesPlatform(ctx context.Context, img *image.Image, platform ocispec.Platform) (bool, error) {
logger := logrus.WithField("image", img.ID).WithField("desiredPlatform", platforms.Format(platform))

ls, leaseErr := i.leases.ListResources(ctx, leases.Lease{ID: imageKey(img.ID().String())})
if leaseErr != nil {
logger.WithError(leaseErr).Error("Error looking up image leases")
return false, leaseErr
ls, err := i.leases.ListResources(ctx, leases.Lease{ID: imageKey(img.ID().String())})
if err != nil {
if cerrdefs.IsNotFound(err) {
return false, nil
}
logger.WithError(err).Error("Error looking up image leases")
return false, err
}

// Note we are comparing against manifest lists here, which we expect to always have a CPU variant set (where applicable).
Expand Down