startupProbe: API changes
This commit is contained in:
@@ -383,6 +383,14 @@ func dropDisabledFields(
|
||||
})
|
||||
}
|
||||
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.StartupProbe) && !startupProbeInUse(oldPodSpec) {
|
||||
// drop startupProbe from all containers if the feature is disabled
|
||||
VisitContainers(podSpec, func(c *api.Container) bool {
|
||||
c.StartupProbe = nil
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
dropDisabledVolumeDevicesFields(podSpec, oldPodSpec)
|
||||
|
||||
dropDisabledRunAsGroupField(podSpec, oldPodSpec)
|
||||
@@ -819,6 +827,24 @@ 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, func(c *api.Container) 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 {
|
||||
|
Reference in New Issue
Block a user