Drop RuntimeClass from PSP when feature is disabled

This commit is contained in:
Tim Allclair
2019-04-24 15:32:57 -07:00
parent 1bd4340c7c
commit c666bd0012
3 changed files with 59 additions and 0 deletions

View File

@@ -38,6 +38,10 @@ func DropDisabledFields(pspSpec, oldPSPSpec *policy.PodSecurityPolicySpec) {
if !utilfeature.DefaultFeatureGate.Enabled(features.CSIInlineVolume) {
pspSpec.AllowedCSIDrivers = nil
}
if !utilfeature.DefaultFeatureGate.Enabled(features.RuntimeClass) &&
(oldPSPSpec == nil || oldPSPSpec.RuntimeClass == nil) {
pspSpec.RuntimeClass = nil
}
}
func allowedProcMountTypesInUse(oldPSPSpec *policy.PodSecurityPolicySpec) bool {