mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Don't guess SELinux support on error
When GetSELinuxSupport() fails, don't assume a mounted filesystem does not support SELinux at all. Try again instead in the next SetUp retry. This may hurt performance a bit, since kubelet will call NodePublishVolume again, but it's better than providing wrong information to the container runtime that will then skip relabeling of the volume.
This commit is contained in:
parent
dba9975e3e
commit
186810eb47
@ -276,7 +276,8 @@ func (c *csiMountMgr) SetUpAt(dir string, mounterArgs volume.MounterArgs) error
|
||||
|
||||
c.supportsSELinux, err = c.kubeVolHost.GetHostUtil().GetSELinuxSupport(dir)
|
||||
if err != nil {
|
||||
klog.V(2).Info(log("error checking for SELinux support: %s", err))
|
||||
// The volume is mounted. Return UncertainProgressError, so kubelet will unmount it when user deletes the pod.
|
||||
return volumetypes.NewUncertainProgressError(fmt.Sprintf("error checking for SELinux support: %s", err))
|
||||
}
|
||||
|
||||
if !driverSupportsCSIVolumeMountGroup && c.supportsFSGroup(fsType, mounterArgs.FsGroup, c.fsGroupPolicy) {
|
||||
|
Loading…
Reference in New Issue
Block a user