mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
Add --no-hostname option
Fixes: https://github.com/containers/podman/issues/25002 Also add the ability to inspect containers for UseImageHosts and UseImageHostname. Finally fixed some bugs in handling of --no-hosts for Pods, which I descovered. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@@ -1711,4 +1711,21 @@ search | $IMAGE |
|
||||
run_podman rm -f -t0 $cname
|
||||
}
|
||||
|
||||
# bats test_tags=ci:parallel
|
||||
@test "podman run - no-hostname" {
|
||||
randomname=c_$(safename)
|
||||
echo "\
|
||||
from $IMAGE
|
||||
RUN umount /etc/hostname; rm /etc/hostname
|
||||
" > $PODMAN_TMPDIR/Containerfile
|
||||
run_podman build -t $randomname --cap-add SYS_ADMIN ${PODMAN_TMPDIR}
|
||||
|
||||
run_podman run --rm $randomname ls /etc/hostname
|
||||
|
||||
run_podman 1 run --no-hostname --rm $randomname ls /etc/hostname
|
||||
is "$output" "ls: /etc/hostname: No such file or directory" "container did not add /etc/hostname"
|
||||
|
||||
run_podman rmi $randomname
|
||||
}
|
||||
|
||||
# vim: filetype=sh
|
||||
|
||||
Reference in New Issue
Block a user