Skip to content

Commit 060a95e

Browse files
committed
Fix panic with health checks
If health checking was enabled, but no readiness probe was defined in the pod templates, the Ingress Controller would crash. This commit fixes that.
1 parent 9ee1117 commit 060a95e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ func findProbeForPods(pods []api_v1.Pod, svcPort *api_v1.ServicePort) *api_v1.Pr
10431043
for _, port := range container.Ports {
10441044
if compareContainerPortAndServicePort(port, *svcPort) {
10451045
// only http ReadinessProbes are useful for us
1046-
if container.ReadinessProbe.Handler.HTTPGet != nil && container.ReadinessProbe.PeriodSeconds > 0 {
1046+
if container.ReadinessProbe != nil && container.ReadinessProbe.Handler.HTTPGet != nil && container.ReadinessProbe.PeriodSeconds > 0 {
10471047
return container.ReadinessProbe
10481048
}
10491049
}

0 commit comments

Comments
 (0)