diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-21 15:15:56 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-22 14:13:07 -0400 |
commit | 6fdcc09a2027d9c929af0389fba131c72b103fcd (patch) | |
tree | cb99539bc278afafd75387b18d60ec8d8049c8c3 /pkg/domain/infra/tunnel/images.go | |
parent | 703fd505538fdae2165dad47c7a6886ac3ed891e (diff) | |
download | podman-6fdcc09a2027d9c929af0389fba131c72b103fcd.tar.gz podman-6fdcc09a2027d9c929af0389fba131c72b103fcd.tar.bz2 podman-6fdcc09a2027d9c929af0389fba131c72b103fcd.zip |
Fix integration tests for untag
Signed-off-by: Brent Baude <bbaude@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain/infra/tunnel/images.go')
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index 822842936..27ed9f1ec 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -7,6 +7,7 @@ import ( "github.com/containers/common/pkg/config" "github.com/containers/image/v5/docker/reference" + "github.com/containers/libpod/pkg/bindings" images "github.com/containers/libpod/pkg/bindings/images" "github.com/containers/libpod/pkg/domain/entities" "github.com/containers/libpod/pkg/domain/utils" @@ -109,6 +110,15 @@ func (ir *ImageEngine) Tag(ctx context.Context, nameOrId string, tags []string, } func (ir *ImageEngine) Untag(ctx context.Context, nameOrId string, tags []string, options entities.ImageUntagOptions) error { + // Remove all tags if none are provided + if len(tags) == 0 { + newImage, err := images.GetImage(ir.ClientCxt, nameOrId, &bindings.PFalse) + if err != nil { + return err + } + tags = newImage.NamesHistory + } + for _, newTag := range tags { var ( tag, repo string |