Merge pull request #23400 from edsantiago/700-fix

CI: 700-play: fix a leaked non-safename
This commit is contained in:
openshift-merge-bot[bot] 2024-07-25 13:33:56 +00:00 committed by GitHub
commit 1466cd5341
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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'"
fi
run_podman pod create --userns auto --name usernspod
run_podman create --pod usernspod $IMAGE true
podname="p-userns-$(safename)"
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"
run_podman inspect --format '{{index .Config.Annotations "io.podman.annotations.userns"}}' $infraID
@ -1055,15 +1056,15 @@ spec:
YAML=$PODMAN_TMPDIR/test.yml
# 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
run_podman kube play --replace $YAML
run_podman pod inspect --format {{.InfraContainerID}} usernspod
run_podman pod inspect --format {{.InfraContainerID}} $podname
infraID="$output"
run_podman inspect --format '{{index .Config.Annotations "io.podman.annotations.userns"}}' $infraID
assert "$output" == "auto" "user namespace should be kept"
run_podman pod rm -f usernspod
run_podman pod rm -f $podname
}