Add log when missing path in health check

This commit is contained in:
Maxence Moutoussamy 2022-06-20 15:40:13 +02:00 committed by GitHub
parent 5c15f5fe04
commit 23340c46e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

View file

@ -311,12 +311,17 @@ func (m *Manager) LaunchHealthCheck() {
}
func buildHealthCheckOptions(ctx context.Context, lb healthcheck.Balancer, backend string, hc *dynamic.ServerHealthCheck) *healthcheck.Options {
if hc == nil || hc.Path == "" {
if hc == nil {
return nil
}
logger := log.FromContext(ctx)
if hc.Path == "" {
logger.Errorf("Ignoring heath check configuration for '%s': no path provided", backend)
return nil
}
interval := defaultHealthCheckInterval
if hc.Interval != "" {
intervalOverride, err := time.ParseDuration(hc.Interval)