Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions pkg/node/kube-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,34 @@ featureGates:
}

func (s *ProxyOptions) Run(ctx context.Context, ready chan<- struct{}, stopped chan<- struct{}) error {
proxyStopErr := make(chan error, 1)

defer close(stopped)

// run readiness check
go func() {
healthcheckStatus := util.RetryInsecureHttpsGet("http://127.0.0.1:10256/healthz")
if healthcheckStatus != 200 {
klog.Fatalf("%s failed to start", s.Name(), fmt.Errorf("Healthcheck failed. "))
err := fmt.Errorf("%s failed to start, healthcheck failed", s.Name())
klog.Error(err)
proxyStopErr <- err
}
klog.Infof("%s is ready", s.Name())
close(ready)
}()
if err := s.options.Run(); err != nil {
klog.Fatalf("%s failed to start", s.Name(), err)
Comment thread
mangelajo marked this conversation as resolved.
Outdated
}

return ctx.Err()
go func() {
if err := s.options.Run(); err != nil {
klog.Errorf("%s failed to start %v", s.Name(), err)
proxyStopErr <- err
}
}()

select {
case <-ctx.Done():
return ctx.Err()

case err := <-proxyStopErr:
return err
}
}