You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the "supress health checks when only one backing service" logic
Previously we had attempted to suppress the health checks, but it was looking at the endpoints of the service, not the servers that back the route. The problem is that if we just look at endpoints, then if a route has two backing services, each with one endpoint, we would incorrectly suppress the health checks.
This is the third attempt. I had missed a case in the last one, so now the logic is moved to be computed and recorded by the router controller, but used in the template.
Fixes bug 1507664 (https://bugzilla.redhat.com/show_bug.cgi?id=1507664)
{{- else if or (eq $cfg.TLSTermination "") (eq $cfg.TLSTermination "edge") }}
411
411
{{- end }}{{/* end type specific options*/}}
412
412
413
-
{{- if not $endpoint.NoHealthCheck }} check inter {{firstMatch $timeSpecPattern (index $cfg.Annotations "router.openshift.io/haproxy.health.check.interval") (env "ROUTER_BACKEND_CHECK_INTERVAL") "5000ms"}}
413
+
{{- if and (not $endpoint.NoHealthCheck) (gt $cfg.ActiveEndpoints 1) }} check inter {{firstMatch $timeSpecPattern (index $cfg.Annotations "router.openshift.io/haproxy.health.check.interval") (env "ROUTER_BACKEND_CHECK_INTERVAL") "5000ms"}}
414
414
{{- end }}{{/* end else no health check */}}
415
-
416
-
417
415
{{- end }}{{/* end if cg.TLSTermination */}}
418
416
{{- end }}{{/* end range processEndpointsForAlias */}}
419
417
{{- end }}{{/* end get serviceUnit from its name */}}
@@ -464,7 +462,7 @@ backend be_tcp:{{$cfgIdx}}
464
462
{{- with $serviceUnit := index $.ServiceUnits $serviceUnitName }}
server {{$endpoint.ID}} {{$endpoint.IP}}:{{$endpoint.Port}} weight {{$weight}}
467
-
{{- if not $endpoint.NoHealthCheck }} check inter {{firstMatch $timeSpecPattern (index $cfg.Annotations "router.openshift.io/haproxy.health.check.interval") (env "ROUTER_BACKEND_CHECK_INTERVAL") "5000ms"}}
465
+
{{- if and (not $endpoint.NoHealthCheck) (gt $cfg.ActiveEndpoints 1) }} check inter {{firstMatch $timeSpecPattern (index $cfg.Annotations "router.openshift.io/haproxy.health.check.interval") (env "ROUTER_BACKEND_CHECK_INTERVAL") "5000ms"}}
468
466
{{- end }}{{/* end else no health check */}}
469
467
{{- end }}{{/* end range processEndpointsForAlias */}}
470
468
{{- end }}{{/* end get ServiceUnit from serviceUnitName */}}
0 commit comments