-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Enable SELinux relabeling in CSI volumes #64026
Conversation
/retest |
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.
please address minor change
pkg/volume/csi/csi_mounter.go
Outdated
path := c.GetPath() | ||
supportSelinux, err := mounter.GetSELinuxSupport(path) | ||
if err != nil { | ||
glog.V(2).Infof("Error checking for SELinux support: %s", err) |
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.
To be consistent with other logging in csi glog.V(2).Info(log("Error checking for SELinux support: %s", err))
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.
Fixed
New changes are detected. LGTM label has been removed. |
/assign @thockin @smarterclayton I'll create pkg/util/nsenter/OWNERS in a separate pr. |
/retest |
from sig-storage /approve |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: childsb, jsafrane, smarterclayton 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 |
Automatic merge from submit-queue (batch tested with PRs 63914, 63887, 64116, 64026, 62933). If you want to cherry-pick this change to another branch, please follow the instructions here. |
@@ -642,22 +633,46 @@ func parseMountInfo(filename string) ([]mountInfo, error) { | |||
} | |||
// See `man proc` for authoritative description of format of the file. | |||
fields := strings.Fields(line) | |||
if len(fields) < 7 { | |||
return nil, fmt.Errorf("wrong number of fields in (expected %d, got %d): %s", 8, len(fields), line) | |||
if len(fields) < 10 { |
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.
make this a constant?
What this PR does / why we need it:
CSI volume plugin should provide correct information in
GetAttributes
call so kubelet can ask container runtime to relabel the volume. Therefore CSI volume plugin needs to check if a random volume mounted by a CSI driver supports SELinux or not by checking for "seclabel" mount or superblock option.Which issue(s) this PR fixes
Fixes #63965
Release note:
@saad-ali @vladimirvivien @davidz627
@cofyc, FYI, I'm changing
struct mountInfo
.