Move pod ReadinessGates feature gate out of validation

This commit is contained in:
Rajath Agasthya
2019-01-08 12:21:49 -08:00
parent 555c63fff5
commit 86165ac878
4 changed files with 110 additions and 5 deletions

View File

@@ -300,6 +300,10 @@ func dropDisabledFields(
podSpec.PriorityClassName = ""
}
if !utilfeature.DefaultFeatureGate.Enabled(features.PodReadinessGates) && !podReadinessGatesInUse(oldPodSpec) {
podSpec.ReadinessGates = nil
}
if !utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) && !emptyDirSizeLimitInUse(oldPodSpec) {
for i := range podSpec.Volumes {
if podSpec.Volumes[i].EmptyDir != nil {
@@ -465,6 +469,17 @@ func podPriorityInUse(podSpec *api.PodSpec) bool {
return false
}
// podReadinessGatesInUse returns true if the pod spec is non-nil and has ReadinessGates
func podReadinessGatesInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {
return false
}
if podSpec.ReadinessGates != nil {
return true
}
return false
}
// emptyDirSizeLimitInUse returns true if any pod's EptyDir volumes use SizeLimit.
func emptyDirSizeLimitInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {