From 63e7c991bca2fe68ff98457d72061d43f49e72a1 Mon Sep 17 00:00:00 2001 From: Till Toenshoff Date: Mon, 25 Apr 2022 11:28:05 +0200 Subject: [PATCH] fix: prevent 404 on ECR during image creation (#100) * feat: introduces no-tags option for inspect * feat: ignore tags when inspecting (cherry picked from commit e000ef7c83441c5e10a83eccfa5f4888fa5e310f) --- cmd/create/imagebundle/image_bundle.go | 1 + skopeo/skopeo.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/cmd/create/imagebundle/image_bundle.go b/cmd/create/imagebundle/image_bundle.go index 46a66437..cc9e7868 100644 --- a/cmd/create/imagebundle/image_bundle.go +++ b/cmd/create/imagebundle/image_bundle.go @@ -147,6 +147,7 @@ func NewCommand(out output.Output) *cobra.Command { srcImageManifestList, skopeoStdout, skopeoStderr, err := skopeoRunner.InspectManifest( context.Background(), fmt.Sprintf("%s%s", srcSkopeoScheme, srcImageName), + skopeo.NoTags(), ) if err != nil { out.V(4). diff --git a/skopeo/skopeo.go b/skopeo/skopeo.go index d1a7d958..be925082 100644 --- a/skopeo/skopeo.go +++ b/skopeo/skopeo.go @@ -77,6 +77,12 @@ func All() SkopeoOption { } } +func NoTags() SkopeoOption { + return func() string { + return "--no-tags" + } +} + func IndexOnly() SkopeoOption { return func() string { return "--multi-arch=index-only"