Skip to content

Commit ad24262

Browse files
committed
daemon/containerd: getPushDescriptor: fix formatting of platform in errors
The platform was printed in its raw format, which didn't produce a very readable output; Before this change: $ docker image save --platform=linux/amd64 -o alpine_amd64.tar alpine:latest Error response from daemon: no suitable export target found for platform linux/amd64: no suitable image manifest found for platform {amd64 linux [] } After this change: $ docker image save --platform=linux/amd64 -o alpine_amd64.tar alpine:latest Error response from daemon: no suitable export target found for platform linux/amd64: no suitable image manifest found for platform linux/amd64 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 2d32d75 commit ad24262

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

daemon/containerd/image_push.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func (i *ImageService) getPushDescriptor(ctx context.Context, img containerdimag
261261

262262
switch len(presentMatchingManifests) {
263263
case 0:
264-
return ocispec.Descriptor{}, errdefs.NotFound(fmt.Errorf("no suitable image manifest found for platform %s", *platform))
264+
return ocispec.Descriptor{}, errdefs.NotFound(fmt.Errorf("no suitable image manifest found for platform %s", platforms.FormatAll(*platform)))
265265
case 1:
266266
// Only one manifest is available AND matching the requested platform.
267267

@@ -293,7 +293,7 @@ func (i *ImageService) getPushDescriptor(ctx context.Context, img containerdimag
293293
return ocispec.Descriptor{}, errdefs.Conflict(errors.Errorf("multiple matching manifests found but no specific platform requested"))
294294
}
295295

296-
return ocispec.Descriptor{}, errdefs.Conflict(errors.Errorf("multiple manifests found for platform %s", *platform))
296+
return ocispec.Descriptor{}, errdefs.Conflict(errors.Errorf("multiple manifests found for platform %s", platforms.FormatAll(*platform)))
297297
}
298298
}
299299

0 commit comments

Comments
 (0)