CI: 700-play: fix a leaked non-safename

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago 2024-07-25 05:49:42 -06:00
parent 34d93d6502
commit fd0ff9060f
1 changed files with 7 additions and 6 deletions

View File

@ -1043,10 +1043,11 @@ spec:
grep -E -q "^containers:" /etc/subuid || skip "no IDs allocated for user 'containers'" grep -E -q "^containers:" /etc/subuid || skip "no IDs allocated for user 'containers'"
fi fi
run_podman pod create --userns auto --name usernspod podname="p-userns-$(safename)"
run_podman create --pod usernspod $IMAGE true run_podman pod create --userns auto --name $podname
run_podman create --pod $podname $IMAGE true
run_podman pod inspect --format {{.InfraContainerID}} usernspod run_podman pod inspect --format {{.InfraContainerID}} $podname
infraID="$output" infraID="$output"
run_podman inspect --format '{{index .Config.Annotations "io.podman.annotations.userns"}}' $infraID run_podman inspect --format '{{index .Config.Annotations "io.podman.annotations.userns"}}' $infraID
@ -1055,15 +1056,15 @@ spec:
YAML=$PODMAN_TMPDIR/test.yml YAML=$PODMAN_TMPDIR/test.yml
# Make sure the same setting is restored if the pod is recreated from the yaml # Make sure the same setting is restored if the pod is recreated from the yaml
run_podman kube generate usernspod -f $YAML run_podman kube generate $podname -f $YAML
cat $YAML cat $YAML
run_podman kube play --replace $YAML run_podman kube play --replace $YAML
run_podman pod inspect --format {{.InfraContainerID}} usernspod run_podman pod inspect --format {{.InfraContainerID}} $podname
infraID="$output" infraID="$output"
run_podman inspect --format '{{index .Config.Annotations "io.podman.annotations.userns"}}' $infraID run_podman inspect --format '{{index .Config.Annotations "io.podman.annotations.userns"}}' $infraID
assert "$output" == "auto" "user namespace should be kept" assert "$output" == "auto" "user namespace should be kept"
run_podman pod rm -f usernspod run_podman pod rm -f $podname
} }