mirror of
https://github.com/containers/podman.git
synced 2025-12-09 07:09:03 +08:00
libpod: fix /etc/hostname with --uts=host
when --uts=host is provided, the expectation is to use the hostname from the host not the container name. Closes: https://github.com/containers/podman/issues/20448 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@@ -911,4 +911,15 @@ EOF
|
||||
run_podman network rm $net1
|
||||
}
|
||||
|
||||
# Issue #20448 - /etc/hostname with --uts=host must show "uname -n"
|
||||
@test "podman --uts=host must use 'uname -n' for /etc/hostname" {
|
||||
run_podman info --format '{{.Host.Hostname}}'
|
||||
hostname="$output"
|
||||
run_podman run --rm --uts=host $IMAGE cat /etc/hostname
|
||||
assert "$output" = $hostname "/etc/hostname with --uts=host must be equal to 'uname -n'"
|
||||
|
||||
run_podman run --rm --net=host --uts=host $IMAGE cat /etc/hostname
|
||||
assert "$output" = $hostname "/etc/hostname with --uts=host --net=host must be equal to 'uname -n'"
|
||||
}
|
||||
|
||||
# vim: filetype=sh
|
||||
|
||||
Reference in New Issue
Block a user