From abdb3b9475b6a30a869c06cbbb6b259b9153c506 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Doumenjou Date: Wed, 20 Nov 2019 18:34:05 +0100 Subject: [PATCH] Uses, if it exists, the ping entry point provided in the static configuration Co-authored-by: Ludovic Fernandez --- cmd/healthcheck/healthcheck.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/healthcheck/healthcheck.go b/cmd/healthcheck/healthcheck.go index bf1c2762f..0a922b2a0 100644 --- a/cmd/healthcheck/healthcheck.go +++ b/cmd/healthcheck/healthcheck.go @@ -51,9 +51,14 @@ func Do(staticConfiguration static.Configuration) (*http.Response, error) { return nil, errors.New("please enable `ping` to use health check") } - pingEntryPoint, ok := staticConfiguration.EntryPoints["traefik"] + ep := staticConfiguration.Ping.EntryPoint + if ep == "" { + ep = "traefik" + } + + pingEntryPoint, ok := staticConfiguration.EntryPoints[ep] if !ok { - return nil, errors.New("missing `ping` entrypoint") + return nil, fmt.Errorf("ping: missing %s entry point", ep) } client := &http.Client{Timeout: 5 * time.Second}