From 9da53c5ba3ee72b34fdde2fae38d607de0cb3ff8 Mon Sep 17 00:00:00 2001 From: Vinayak Goyal Date: Sun, 29 Sep 2024 04:02:55 +0000 Subject: [PATCH] KEP-2862: Fine-grained Kubelet API Authorization Signed-off-by: Vinayak Goyal Kubernetes-commit: b1f290d444f75b351f77f4d3292bbf557ae1cc45 --- pkg/server/healthz/healthz.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/server/healthz/healthz.go b/pkg/server/healthz/healthz.go index 76f5745b3..730929331 100644 --- a/pkg/server/healthz/healthz.go +++ b/pkg/server/healthz/healthz.go @@ -35,6 +35,8 @@ import ( "k8s.io/klog/v2" ) +const DefaultHealthzPath = "/healthz" + // HealthChecker is a named healthz checker. type HealthChecker interface { Name() string @@ -154,7 +156,7 @@ func NamedCheck(name string, check func(r *http.Request) error) HealthChecker { // exactly one call to InstallHandler. Calling InstallHandler more // than once for the same mux will result in a panic. func InstallHandler(mux mux, checks ...HealthChecker) { - InstallPathHandler(mux, "/healthz", checks...) + InstallPathHandler(mux, DefaultHealthzPath, checks...) } // InstallReadyzHandler registers handlers for health checking on the path