mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-05-28 04:04:39 -04:00
Merge pull request #135232 from jsut21/kubelet/healthz-untilwithcontext-126379
kubelet: use wait.UntilWithContext for healthz server (structured logging)
This commit is contained in:
commit
cd48cabb04
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue