From 99c6fb09e9cb0cecf98ae7842031ca6199de3f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 28 May 2025 22:30:23 +0200 Subject: [PATCH] Also exit with status 2 for missing tags in oci-archive: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No tests because we aren't testing oci-archive: anywhere else either. Signed-off-by: Miloslav Trmač --- cmd/skopeo/utils.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/skopeo/utils.go b/cmd/skopeo/utils.go index a14e0a08..77ce7704 100644 --- a/cmd/skopeo/utils.go +++ b/cmd/skopeo/utils.go @@ -13,6 +13,7 @@ import ( "github.com/containers/common/pkg/retry" "github.com/containers/image/v5/directory" "github.com/containers/image/v5/manifest" + ociarchive "github.com/containers/image/v5/oci/archive" ocilayout "github.com/containers/image/v5/oci/layout" "github.com/containers/image/v5/pkg/compression" "github.com/containers/image/v5/storage" @@ -420,9 +421,11 @@ func promptForPassphrase(privateKeyFile string, stdin, stdout *os.File) (string, // TODO drive this into containers/image properly func isNotFoundImageError(err error) bool { var layoutImageNotFoundError ocilayout.ImageNotFoundError + var archiveImageNotFoundError ociarchive.ImageNotFoundError return isDockerManifestUnknownError(err) || errors.Is(err, storage.ErrNoSuchImage) || - errors.As(err, &layoutImageNotFoundError) + errors.As(err, &layoutImageNotFoundError) || + errors.As(err, &archiveImageNotFoundError) } // isDockerManifestUnknownError is a copy of code from containers/image,