summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-08 12:57:37 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-08 20:12:20 +0000
commitc246b9d24f27c9ef020a044eee95ffc440145146 (patch)
tree3b9f6c98e0b9fb4ca986c472392e7e833874ac1a
parent3d05f100f7be78932242d3d09a88e4a6236a0d3c (diff)
downloadpodman-c246b9d24f27c9ef020a044eee95ffc440145146.tar.gz
podman-c246b9d24f27c9ef020a044eee95ffc440145146.tar.bz2
podman-c246b9d24f27c9ef020a044eee95ffc440145146.zip
Shortname deletion continued
With certain short name usages, rmi still was unable to delete certain images. This was also reflected in several commit tests that were temporarily disabled. Signed-off-by: baude <bbaude@redhat.com> Closes: #200 Approved by: rhatdan
-rw-r--r--libpod/runtime_img.go4
-rw-r--r--test/podman_commit.bats6
2 files changed, 4 insertions, 6 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index 66630beb2..671e08c19 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -347,6 +347,7 @@ func getTags(nameInput string) (reference.NamedTagged, bool, error) {
func (k *Image) GetLocalImageName() (string, error) {
_, err := k.runtime.GetImage(k.Name)
if err == nil {
+ k.LocalName = k.Name
return k.Name, nil
}
localImages, err := k.runtime.GetImages(&ImageFilterParams{})
@@ -359,6 +360,7 @@ func (k *Image) GetLocalImageName() (string, error) {
}
for _, image := range localImages {
if strings.HasPrefix(image.ID, k.Name) {
+ k.ID = image.ID
return image.ID, nil
}
for _, name := range image.Names {
@@ -379,11 +381,13 @@ func (k *Image) GetLocalImageName() (string, error) {
}
if imageName == k.Name {
+ k.LocalName = name
return name, nil
}
imageSplit := strings.Split(imageName, "/")
baseName := imageSplit[len(imageSplit)-1]
if baseName == k.Name {
+ k.LocalName = name
return name, nil
}
}
diff --git a/test/podman_commit.bats b/test/podman_commit.bats
index 10cc724f1..9257743e9 100644
--- a/test/podman_commit.bats
+++ b/test/podman_commit.bats
@@ -13,7 +13,6 @@ function setup() {
}
@test "podman commit default" {
- skip "Skipping until docker name removed from image store assumptions"
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d --name my_ctr ${FEDORA_MINIMAL} sleep 6000"
echo "$output"
[ "$status" -eq 0 ]
@@ -32,7 +31,6 @@ function setup() {
}
@test "podman commit with message flag" {
- skip "Skipping until docker name removed from image store assumptions"
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d --name my_ctr ${FEDORA_MINIMAL} sleep 6000"
echo "$output"
[ "$status" -eq 0 ]
@@ -51,7 +49,6 @@ function setup() {
}
@test "podman commit with author flag" {
- skip "Skipping until docker name removed from image store assumptions"
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d --name my_ctr ${FEDORA_MINIMAL} sleep 6000"
echo "$output"
[ "$status" -eq 0 ]
@@ -70,7 +67,6 @@ function setup() {
}
@test "podman commit with change flag" {
- skip "Skipping until docker name removed from image store assumptions"
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d --name my_ctr ${FEDORA_MINIMAL} sleep 6000"
echo "$output"
[ "$status" -eq 0 ]
@@ -89,7 +85,6 @@ function setup() {
}
@test "podman commit with pause flag" {
- skip "Skipping until docker name removed from image store assumptions"
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run -d --name my_ctr ${FEDORA_MINIMAL} sleep 6000"
echo "$output"
[ "$status" -eq 0 ]
@@ -108,7 +103,6 @@ function setup() {
}
@test "podman commit non-running container" {
- skip "Skipping until docker name removed from image store assumptions"
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} create --name my_ctr ${FEDORA_MINIMAL} ls"
echo "$output"
[ "$status" -eq 0 ]