Skip to content

Commit 7806e00

Browse files
Merge pull request #2808 from mickael-carl/mcarl/warn-liveness-failing
feat: warn on probe failing
2 parents ef2af5b + 72c87eb commit 7806e00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/app/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ func handleClusterDelegationForProber(client kubernetes.Interface, probeType str
515515
return func(w http.ResponseWriter, _ *http.Request) {
516516
got := client.CoreV1().RESTClient().Get().AbsPath(probeType).Do(context.Background())
517517
if got.Error() != nil {
518+
var statusCode int
519+
got.StatusCode(&statusCode)
520+
klog.Warningf("Failed to contact API server for %s: got %d", probeType, statusCode)
518521
w.WriteHeader(http.StatusServiceUnavailable)
519522
w.Write([]byte(http.StatusText(http.StatusServiceUnavailable)))
520523
return

0 commit comments

Comments
 (0)