mirror of
https://github.com/containers/skopeo.git
synced 2025-09-15 06:20:12 +00:00
Merge pull request #738 from mtrmac/inspect-aws-403
Don't critically fail on a 403 when listing tags
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/containers/image/v5/image"
|
"github.com/containers/image/v5/image"
|
||||||
"github.com/containers/image/v5/manifest"
|
"github.com/containers/image/v5/manifest"
|
||||||
"github.com/containers/image/v5/transports"
|
"github.com/containers/image/v5/transports"
|
||||||
"github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
@@ -177,7 +177,9 @@ func (opts *inspectOptions) run(args []string, stdout io.Writer) (retErr error)
|
|||||||
// some registries may decide to block the "list all tags" endpoint
|
// some registries may decide to block the "list all tags" endpoint
|
||||||
// gracefully allow the inspect to continue in this case. Currently
|
// gracefully allow the inspect to continue in this case. Currently
|
||||||
// the IBM Bluemix container registry has this restriction.
|
// the IBM Bluemix container registry has this restriction.
|
||||||
if !strings.Contains(err.Error(), "401") {
|
// In addition, AWS ECR rejects it with 403 (Forbidden) if the "ecr:ListImages"
|
||||||
|
// action is not allowed.
|
||||||
|
if !strings.Contains(err.Error(), "401") && !strings.Contains(err.Error(), "403") {
|
||||||
return fmt.Errorf("Error determining repository tags: %v", err)
|
return fmt.Errorf("Error determining repository tags: %v", err)
|
||||||
}
|
}
|
||||||
logrus.Warnf("Registry disallows tag list retrieval; skipping")
|
logrus.Warnf("Registry disallows tag list retrieval; skipping")
|
||||||
|
Reference in New Issue
Block a user