diff options
author | baude <bbaude@redhat.com> | 2018-03-23 13:50:56 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-26 14:54:10 +0000 |
commit | 1d4f40bd1ace049eb09736358c870aa654011c3f (patch) | |
tree | 1f2e1a847a1054f6f56fa7f16d4089ea59562671 | |
parent | 7d4f82c020c2b1ee763b98d4f963b3a97726fb70 (diff) | |
download | podman-1d4f40bd1ace049eb09736358c870aa654011c3f.tar.gz podman-1d4f40bd1ace049eb09736358c870aa654011c3f.tar.bz2 podman-1d4f40bd1ace049eb09736358c870aa654011c3f.zip |
First tag, untag THEN reload the image
Signed-off-by: baude <bbaude@redhat.com>
Closes: #543
Approved by: mheon
-rw-r--r-- | libpod/image/image.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go index ac2431a56..b08fa1acd 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -354,6 +354,7 @@ func getImageDigest(src types.ImageReference, ctx *types.SystemContext) (string, // TagImage adds a tag to the given image func (i *Image) TagImage(tag string) error { + i.reloadImage() decomposedTag, err := decompose(tag) if err != nil { return err @@ -367,12 +368,16 @@ func (i *Image) TagImage(tag string) error { return nil } tags = append(tags, tag) + if err := i.imageruntime.store.SetNames(i.ID(), tags); err != nil { + return err + } i.reloadImage() - return i.imageruntime.store.SetNames(i.ID(), tags) + return nil } // UntagImage removes a tag from the given image func (i *Image) UntagImage(tag string) error { + i.reloadImage() var newTags []string tags := i.Names() if !util.StringInSlice(tag, tags) { @@ -383,8 +388,11 @@ func (i *Image) UntagImage(tag string) error { newTags = append(newTags, t) } } + if err := i.imageruntime.store.SetNames(i.ID(), newTags); err != nil { + return err + } i.reloadImage() - return i.imageruntime.store.SetNames(i.ID(), newTags) + return nil } // PushImage pushes the given image to a location described by the given path |