Add CSIDriverSpec.SELinuxMount
The new field tells Kubernetes if the CSI driver supports mounting of volumes with -o context=XYZ or not.
This commit is contained in:
@@ -50,6 +50,9 @@ func (csiDriverStrategy) PrepareForCreate(ctx context.Context, obj runtime.Objec
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.CSIInlineVolume) {
|
||||
csiDriver.Spec.VolumeLifecycleModes = nil
|
||||
}
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.SELinuxMountReadWriteOncePod) {
|
||||
csiDriver.Spec.SELinuxMount = nil
|
||||
}
|
||||
}
|
||||
|
||||
func (csiDriverStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
|
||||
@@ -87,6 +90,11 @@ func (csiDriverStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.
|
||||
if !apiequality.Semantic.DeepEqual(oldCSIDriver.Spec.TokenRequests, newCSIDriver.Spec.TokenRequests) || !apiequality.Semantic.DeepEqual(oldCSIDriver.Spec.RequiresRepublish, newCSIDriver.Spec.RequiresRepublish) {
|
||||
newCSIDriver.Generation = oldCSIDriver.Generation + 1
|
||||
}
|
||||
|
||||
if oldCSIDriver.Spec.SELinuxMount == nil &&
|
||||
!utilfeature.DefaultFeatureGate.Enabled(features.SELinuxMountReadWriteOncePod) {
|
||||
newCSIDriver.Spec.SELinuxMount = nil
|
||||
}
|
||||
}
|
||||
|
||||
func (csiDriverStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
||||
|
Reference in New Issue
Block a user