diff --git a/cmd/skopeo/inspect.go b/cmd/skopeo/inspect.go index 9c364f4c..1b8adf77 100644 --- a/cmd/skopeo/inspect.go +++ b/cmd/skopeo/inspect.go @@ -205,9 +205,13 @@ func (opts *inspectOptions) run(args []string, stdout io.Writer) (retErr error) if err != nil { // Some registries may decide to block the "list all tags" endpoint; // gracefully allow the inspect to continue in this case: + fatalFailure := true // - AWS ECR rejects it with 403 (Forbidden) if the "ecr:ListImages" // action is not allowed. - if !strings.Contains(err.Error(), "403") { + if strings.Contains(err.Error(), "403") { + fatalFailure = false + } + if fatalFailure { return fmt.Errorf("Error determining repository tags: %w", err) } logrus.Warnf("Registry disallows tag list retrieval; skipping")