mirror of
https://github.com/containers/skopeo.git
synced 2025-08-31 14:20:21 +00:00
Reorganize the "list tags failed" logic in inspect.go a bit
... to allow adding more cases. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user