Remove StartupProbe featuregate and related logic

This commit is contained in:
Matthias Bertschy
2020-08-21 13:36:27 +02:00
parent 61edc6f9d1
commit ea14585500
12 changed files with 164 additions and 268 deletions

View File

@@ -406,14 +406,6 @@ func dropDisabledFields(
})
}
if !utilfeature.DefaultFeatureGate.Enabled(features.StartupProbe) && !startupProbeInUse(oldPodSpec) {
// drop startupProbe from all containers if the feature is disabled
VisitContainers(podSpec, AllContainers, func(c *api.Container, containerType ContainerType) bool {
c.StartupProbe = nil
return true
})
}
dropDisabledRunAsGroupField(podSpec, oldPodSpec)
dropDisabledFSGroupFields(podSpec, oldPodSpec)
@@ -696,24 +688,6 @@ func subpathExprInUse(podSpec *api.PodSpec) bool {
return inUse
}
// startupProbeInUse returns true if the pod spec is non-nil and has a container that has a startupProbe defined
func startupProbeInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {
return false
}
var inUse bool
VisitContainers(podSpec, AllContainers, func(c *api.Container, containerType ContainerType) bool {
if c.StartupProbe != nil {
inUse = true
return false
}
return true
})
return inUse
}
// csiInUse returns true if any pod's spec include inline CSI volumes.
func csiInUse(podSpec *api.PodSpec) bool {
if podSpec == nil {