retry on apiserver insecure listen failures
This commit is contained in:
@@ -750,8 +750,18 @@ func (s *GenericAPIServer) Run(options *options.ServerRunOptions) {
|
|||||||
Handler: apiserver.RecoverPanics(handler),
|
Handler: apiserver.RecoverPanics(handler),
|
||||||
MaxHeaderBytes: 1 << 20,
|
MaxHeaderBytes: 1 << 20,
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.Infof("Serving insecurely on %s", insecureLocation)
|
glog.Infof("Serving insecurely on %s", insecureLocation)
|
||||||
glog.Fatal(http.ListenAndServe())
|
go func() {
|
||||||
|
defer utilruntime.HandleCrash()
|
||||||
|
for {
|
||||||
|
if err := http.ListenAndServe(); err != nil {
|
||||||
|
glog.Errorf("Unable to listen for insecure (%v); will try again.", err)
|
||||||
|
}
|
||||||
|
time.Sleep(15 * time.Second)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
select {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exposes the given group version in API.
|
// Exposes the given group version in API.
|
||||||
|
Reference in New Issue
Block a user