Skip to content
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

Correct output when inspecting containers created with --ipc #17201

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jan 24, 2023

Fixes: #17189

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

Does this PR introduce a user-facing change?

Fix output of podman inspect to correctly report the IPCMode of containers.

@openshift-ci openshift-ci bot added the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Jan 24, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note and removed do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None labels Jan 24, 2023
@mheon
Copy link
Member

mheon commented Jan 24, 2023

LGTM

Fixes: containers#17189

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@rhatdan
Copy link
Member Author

rhatdan commented Jan 24, 2023

@Luap99 Mine or yours, or should we merge.

@Luap99
Copy link
Member

Luap99 commented Jan 24, 2023

I don't care, both seem to do the same code and test wise, they are just using a bit different syntax.

How about we let @edsantiago decide which test change he likes better? This PR or #17200?

@edsantiago
Copy link
Member

I've only skimmed these two (and restarted flakes). I will review in the next hour, but am OK if someone beats me to it.

Copy link
Member

@edsantiago edsantiago left a 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"
}
if hostConfig.IpcMode == "" {
hostConfig.IpcMode = "shareable"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer a switch to the if/elses in #17200, but I can't convince myself that this part of the change is equivalent. If a default case is possible, and none of the conditions trigger, won't IpcMode be left blank? (I don't know if this is possible)

Moving line 186 (initialization to "host") to line 177 (before the switch) would ease my mind, but perhaps it's obvious to those familiar with this code why that is not necessary.

is "$output" "$hostipc" "HostIPC and container IPC should be same"
run_podman inspect IPC --format '{{ .HostConfig.IpcMode }}'
is "$output" "host" "host mode should be selected"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rhatdan rhatdan added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2023
@rhatdan
Copy link
Member Author

rhatdan commented Jan 24, 2023

Ok I will merge mine, but I still think we can get some of @Luap99 improvements in a different PR.

@openshift-merge-robot openshift-merge-robot merged commit 3cee9d9 into containers:main Jan 24, 2023
vrothberg added a commit to vrothberg/libpod that referenced this pull request Jan 27, 2023
containers/pull/17186 and containers/pull/17201 have been
merged at roughly the same time.  Both work fine in isolation but the
new kube test breaks in combination.

Fix the IPC kube test to make CI healthy.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: podman run --ipc=host not work as expected
5 participants