plugin/health: Poll localhost by default (#5934)

defaulting to localhost makes things explicit in CoreDNS code, and will give us valid URIs in
the logs

Signed-off-by: W. Trevor King <wking@tremily.us>
This commit is contained in:
W. Trevor King
2023-03-29 06:57:54 -07:00
committed by GitHub
parent f823825f8a
commit 0063d7a80c
3 changed files with 29 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"net/http"
"net/http/httptest"
"net/url"
"testing"
"time"
)
@@ -22,6 +23,13 @@ func Test_health_overloaded_cancellation(t *testing.T) {
stop: cancel,
}
var err error
h.healthURI, err = url.Parse(ts.URL)
if err != nil {
t.Fatal(err)
}
h.healthURI.Path = "/health"
stopped := make(chan struct{})
go func() {
h.overloaded(ctx)