Reconstruct SELinux mount option
When reconstructing volumes from disk after kubelet restart, reconstruct also context=XYZ mount option and add it to the ActualStateOfWorld.
This commit is contained in:
@@ -430,8 +430,18 @@ func (plugin *rbdPlugin) ConstructVolumeSpec(volumeName, mountPath string) (volu
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var mountContext string
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.SELinuxMountReadWriteOncePod) {
|
||||
mountContext, err = hu.GetSELinuxMountContext(mountPath)
|
||||
if err != nil {
|
||||
return volume.ReconstructedVolume{}, err
|
||||
}
|
||||
}
|
||||
|
||||
return volume.ReconstructedVolume{
|
||||
Spec: volume.NewSpecFromVolume(rbdVolume),
|
||||
Spec: volume.NewSpecFromVolume(rbdVolume),
|
||||
SELinuxMountContext: mountContext,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user