Skip to content

Commit 3ebe6a6

Browse files
authored
Merge pull request kubernetes#77807 from matthyx/startupProbe
Add startupProbe to health checks
2 parents 7acb066 + a042a4b commit 3ebe6a6

File tree

104 files changed

+19821
-15610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+19821
-15610
lines changed

api/openapi-spec/swagger.json

Lines changed: 15 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/pod/util.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,14 @@ func dropDisabledFields(
383383
})
384384
}
385385

386+
if !utilfeature.DefaultFeatureGate.Enabled(features.StartupProbe) && !startupProbeInUse(oldPodSpec) {
387+
// drop startupProbe from all containers if the feature is disabled
388+
VisitContainers(podSpec, func(c *api.Container) bool {
389+
c.StartupProbe = nil
390+
return true
391+
})
392+
}
393+
386394
dropDisabledVolumeDevicesFields(podSpec, oldPodSpec)
387395

388396
dropDisabledRunAsGroupField(podSpec, oldPodSpec)
@@ -819,6 +827,24 @@ func subpathExprInUse(podSpec *api.PodSpec) bool {
819827
return inUse
820828
}
821829

830+
// startupProbeInUse returns true if the pod spec is non-nil and has a container that has a startupProbe defined
831+
func startupProbeInUse(podSpec *api.PodSpec) bool {
832+
if podSpec == nil {
833+
return false
834+
}
835+
836+
var inUse bool
837+
VisitContainers(podSpec, func(c *api.Container) bool {
838+
if c.StartupProbe != nil {
839+
inUse = true
840+
return false
841+
}
842+
return true
843+
})
844+
845+
return inUse
846+
}
847+
822848
// csiInUse returns true if any pod's spec include inline CSI volumes.
823849
func csiInUse(podSpec *api.PodSpec) bool {
824850
if podSpec == nil {

pkg/apis/apps/v1/zz_generated.defaults.go

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/apps/v1beta1/zz_generated.defaults.go

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)