Uses, if it exists, the ping entry point provided in the static configuration
Co-authored-by: Ludovic Fernandez <ldez@users.noreply.github.com>
This commit is contained in:
parent
9761161163
commit
abdb3b9475
1 changed files with 7 additions and 2 deletions
|
@ -51,9 +51,14 @@ func Do(staticConfiguration static.Configuration) (*http.Response, error) {
|
||||||
return nil, errors.New("please enable `ping` to use health check")
|
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 {
|
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}
|
client := &http.Client{Timeout: 5 * time.Second}
|
||||||
|
|
Loading…
Reference in a new issue