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

Refine relabel step #2078

Merged
merged 1 commit into from May 14, 2024
Merged

Conversation

davidcassany
Copy link
Contributor

No description provided.

Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany davidcassany requested a review from a team as a code owner May 13, 2024 14:01
cmd/config/config.go Show resolved Hide resolved
@@ -420,6 +421,13 @@ func SelinuxRelabel(cfg *types.RunConfig, spec *types.MountSpec) error {

paths := []string{}
paths = append(paths, spec.Ephemeral.Paths...)
for _, vol := range append(spec.Volumes, &spec.Persistent.Volume) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to also relabel /oem and other eventual volumes mounted as RW.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, I was thinking of this, but would it not impact the persistent volume as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the idea is to also relabel the persistent volume. The only case in which is not relabeled is when this is mounted under /run. I have not fully tested it yet, but I'd like to be capable to set the persistent volume mountpoint to /var, in that case we should also relabel /var.

To be honest to it looks like we might need to revisit this part as long as we gain experience and encounter new corner cases. It is hard to generalize.

pkg/action/mount.go Show resolved Hide resolved
@davidcassany davidcassany enabled auto-merge (rebase) May 13, 2024 14:12
Copy link
Contributor

@frelon frelon left a comment

Choose a reason for hiding this comment

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

Some small comments, LGTM!

@davidcassany davidcassany merged commit 7686d12 into rancher:main May 14, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants