-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix ipc namespace inspect logic #17200
Conversation
The ipc ns inspect logic did not work, the switch case was just broken because it will only execute the first branch. Therefore it always showed `shareable` or `container:...` as mode. This fixes the logic and adds tests for all modes. Fixes containers#17189 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 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 |
We also have #17201 - solutions basically identical. Maybe combine the tests though? |
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.
Sorry y'all, this is not a decision I can make. Tests look great to me (side note: I am really, really, really appreciative of all the thought everyone is giving to tests). But the changes in setting IpcMode
are beyond my ability to understand.
case c.config.NoShm: | ||
hostConfig.IpcMode = "none" | ||
case c.config.NoShmShare: | ||
hostConfig.IpcMode = "private" |
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.
I'm not qualified to judge if this excision is OK.
assert "$output" != "$hostipc" "containeripc should != hostipc" | ||
|
||
run_podman container inspect --format "{{.HostConfig.IpcMode}}" $cname | ||
assert "none" "inspect should show none ipc" |
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.
Same feedback (nonblocking, just for future reference) as in #17201 :
Just as a suggestion for future, not a blocker: I like my failure messages to make it clear why something is expected, not what is expected. (The "what" will be shown as part of the error message). Something like
is "$output" "host" ".HostConfig.IpcMode when --ipc=host"
That makes the error message something like:
FAIL: .HostConfig.IpcMode when --ipc=host
expected: host
got: slaartibartfast
The ipc ns inspect logic did not work, the switch case was just broken because it will only execute the first branch. Therefore it always showed
shareable
orcontainer:...
as mode.This fixes the logic and adds tests for all modes.
Fixes #17189
Does this PR introduce a user-facing change?