-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libpod: fix /etc/hostname with --uts=host #20545
libpod: fix /etc/hostname with --uts=host #20545
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a few nits, none of them worth a repush on their own
test/system/500-networking.bats
Outdated
skip_if_remote "cannot check 'uname -n' on remote" | ||
hostname=`uname -n` | ||
run_podman run --rm --uts=host $IMAGE cat /etc/hostname | ||
assert "$output" = $hostname "/etc/hostname must contain 'uname -n'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure comment is a little misleading: it's not "contain", it's "be" or "equal".
Also, it's good practice to make failure comments unique. That way a monkey like me, seeing a failure message, can grep for it in the source and find exactly one hit. If there are two hits, monkeys get confused. Perhaps something like this:
... "/etc/hostname with --uts=host"
....
... "/etc/hostname with --net=host and --uts=host"
test/system/500-networking.bats
Outdated
@@ -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" { | |||
skip_if_remote "cannot check 'uname -n' on remote" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_podman info --format '{{.Host.Hostname}}'
?
when --uts=host is provided, the expectation is to use the hostname from the host not the container name. Closes: containers#20448 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
9bed293
to
b332ca7
Compare
@edsantiago thanks for the hints, I think they are worth a re-push |
/lgtm |
LGTM2 /unhold |
when --uts=host is provided, the expectation is to use the hostname from the host not the container name.
Closes: #20448
Does this PR introduce a user-facing change?