fix typo

Signed-off-by: Takuto Sato <tockn.jp@gmail.com>
This commit is contained in:
tockn 2022-10-06 00:31:45 +09:00 committed by Takuto Sato
parent 109eafc3f8
commit 89a9d7d650
1 changed files with 3 additions and 3 deletions

View File

@ -161,12 +161,12 @@ func (i *ImageService) GetImage(ctx context.Context, refOrID string, options ima
} }
p := *options.Platform p := *options.Platform
// Note that `platforms.Only` will fuzzy match this for us // Note that `platforms.Only` will fuzzy match this for us
// For example: an armv6 image will run just fine an an armv7 CPU, without emulation or anything. // For example: an armv6 image will run just fine on an armv7 CPU, without emulation or anything.
if OnlyPlatformWithFallback(p).Match(imgPlat) { if OnlyPlatformWithFallback(p).Match(imgPlat) {
return return
} }
// In some cases the image config can actually be wrong (e.g. classic `docker build` may not handle `--platform` correctly) // In some cases the image config can actually be wrong (e.g. classic `docker build` may not handle `--platform` correctly)
// So we'll look up the manifest list that coresponds to this imaage to check if at least the manifest list says it is the correct image. // So we'll look up the manifest list that corresponds to this image to check if at least the manifest list says it is the correct image.
var matches bool var matches bool
matches, retErr = i.manifestMatchesPlatform(ctx, retImg, p) matches, retErr = i.manifestMatchesPlatform(ctx, retImg, p)
if matches || retErr != nil { if matches || retErr != nil {
@ -179,7 +179,7 @@ func (i *ImageService) GetImage(ctx context.Context, refOrID string, options ima
// The image store does not store the manifest list and image tags are assigned to architecture specific images. // The image store does not store the manifest list and image tags are assigned to architecture specific images.
// So we can have a `foo` image that is amd64 but the user requested armv7. If the user looks at the list of images. // So we can have a `foo` image that is amd64 but the user requested armv7. If the user looks at the list of images.
// This may be confusing. // This may be confusing.
// The alternative to this is to return a errdefs.Conflict error with a helpful message, but clients will not be // The alternative to this is to return an errdefs.Conflict error with a helpful message, but clients will not be
// able to automatically tell what causes the conflict. // able to automatically tell what causes the conflict.
retErr = errdefs.NotFound(errors.Errorf("image with reference %s was found but does not match the specified platform: wanted %s, actual: %s", refOrID, platforms.Format(p), platforms.Format(imgPlat))) retErr = errdefs.NotFound(errors.Errorf("image with reference %s was found but does not match the specified platform: wanted %s, actual: %s", refOrID, platforms.Format(p), platforms.Format(imgPlat)))
}() }()