Merge pull request #21267 from danishprakash/new-pod-behavior

rm pod with run, create if ctr creation failed with --pod new:
This commit is contained in:
openshift-merge-bot[bot]
2024-01-17 20:20:52 +00:00
committed by GitHub
3 changed files with 42 additions and 0 deletions

View File

@@ -1399,4 +1399,20 @@ search | $IMAGE |
run_podman rm -f -t0 $cid
}
@test "podman run - rm pod if container creation failed with -pod new:" {
run_podman run -d --name foobar $IMAGE hostname
cid=$output
podname=pod$(random_string)
run_podman 125 run --rm --pod "new:$podname" --name foobar $IMAGE hostname
is "$output" ".*creating container storage: the container name \"foobar\" is already in use by"
# pod should've been cleaned up
# if container creation failed
run_podman 1 pod exists $podname
run_podman rm $cid
run_podman rmi $(pause_image)
}
# vim: filetype=sh