mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
kubelet: use wait.UntilWithContext for healthz server (issue #126379)
This commit is contained in:
@@ -905,12 +905,12 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend
|
||||
if s.HealthzPort > 0 {
|
||||
mux := http.NewServeMux()
|
||||
healthz.InstallHandler(mux)
|
||||
go wait.Until(func() {
|
||||
go wait.UntilWithContext(ctx, func(ctx context.Context) {
|
||||
err := http.ListenAndServe(net.JoinHostPort(s.HealthzBindAddress, strconv.Itoa(int(s.HealthzPort))), mux)
|
||||
if err != nil {
|
||||
logger.Error(err, "Failed to start healthz server")
|
||||
}
|
||||
}, 5*time.Second, wait.NeverStop)
|
||||
}, 5*time.Second)
|
||||
}
|
||||
|
||||
// If systemd is used, notify it that we have started
|
||||
|
||||
Reference in New Issue
Block a user