Remove EvenPodsSpread featuregate and related logic

This commit is contained in:
Wei Huang
2020-05-27 14:24:26 -07:00
parent 3995c1a54d
commit 133dde6358
19 changed files with 65 additions and 104 deletions

View File

@@ -438,11 +438,6 @@ func dropDisabledFields(
// does not specify any values for these fields.
podSpec.PreemptionPolicy = nil
}
if !utilfeature.DefaultFeatureGate.Enabled(features.EvenPodsSpread) && !topologySpreadConstraintsInUse(oldPodSpec) {
// Set TopologySpreadConstraints to nil only if feature is disabled and it is not used
podSpec.TopologySpreadConstraints = nil
}
}
// dropDisabledRunAsGroupField removes disabled fields from PodSpec related
@@ -558,14 +553,6 @@ func overheadInUse(podSpec *api.PodSpec) bool {
return false
}
// topologySpreadConstraintsInUse returns true if the pod spec is non-nil and has a TopologySpreadConstraints slice
func topologySpreadConstraintsInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {
return false
}
return len(podSpec.TopologySpreadConstraints) > 0
}
// procMountInUse returns true if the pod spec is non-nil and has a SecurityContext's ProcMount field set to a non-default value
func procMountInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {