mirror of
https://github.com/containers/skopeo.git
synced 2025-09-01 06:37:32 +00:00
Also exit with status 2 for missing tags in oci-archive:
No tests because we aren't testing oci-archive: anywhere else either. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/containers/common/pkg/retry"
|
"github.com/containers/common/pkg/retry"
|
||||||
"github.com/containers/image/v5/directory"
|
"github.com/containers/image/v5/directory"
|
||||||
"github.com/containers/image/v5/manifest"
|
"github.com/containers/image/v5/manifest"
|
||||||
|
ociarchive "github.com/containers/image/v5/oci/archive"
|
||||||
ocilayout "github.com/containers/image/v5/oci/layout"
|
ocilayout "github.com/containers/image/v5/oci/layout"
|
||||||
"github.com/containers/image/v5/pkg/compression"
|
"github.com/containers/image/v5/pkg/compression"
|
||||||
"github.com/containers/image/v5/storage"
|
"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
|
// TODO drive this into containers/image properly
|
||||||
func isNotFoundImageError(err error) bool {
|
func isNotFoundImageError(err error) bool {
|
||||||
var layoutImageNotFoundError ocilayout.ImageNotFoundError
|
var layoutImageNotFoundError ocilayout.ImageNotFoundError
|
||||||
|
var archiveImageNotFoundError ociarchive.ImageNotFoundError
|
||||||
return isDockerManifestUnknownError(err) ||
|
return isDockerManifestUnknownError(err) ||
|
||||||
errors.Is(err, storage.ErrNoSuchImage) ||
|
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,
|
// isDockerManifestUnknownError is a copy of code from containers/image,
|
||||||
|
Reference in New Issue
Block a user