update dependencies (#6267)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
29
vendor/k8s.io/apiserver/pkg/server/healthz/healthz.go
generated
vendored
29
vendor/k8s.io/apiserver/pkg/server/healthz/healthz.go
generated
vendored
@@ -105,6 +105,29 @@ func (i *informerSync) Name() string {
|
||||
return "informer-sync"
|
||||
}
|
||||
|
||||
type shutdown struct {
|
||||
stopCh <-chan struct{}
|
||||
}
|
||||
|
||||
// NewShutdownHealthz returns a new HealthChecker that will fail if the embedded channel is closed.
|
||||
// This is intended to allow for graceful shutdown sequences.
|
||||
func NewShutdownHealthz(stopCh <-chan struct{}) HealthChecker {
|
||||
return &shutdown{stopCh}
|
||||
}
|
||||
|
||||
func (s *shutdown) Name() string {
|
||||
return "shutdown"
|
||||
}
|
||||
|
||||
func (s *shutdown) Check(req *http.Request) error {
|
||||
select {
|
||||
case <-s.stopCh:
|
||||
return fmt.Errorf("process is shutting down")
|
||||
default:
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *informerSync) Check(_ *http.Request) error {
|
||||
stopCh := make(chan struct{})
|
||||
// Close stopCh to force checking if informers are synced now.
|
||||
@@ -142,12 +165,6 @@ func InstallReadyzHandler(mux mux, checks ...HealthChecker) {
|
||||
InstallPathHandler(mux, "/readyz", checks...)
|
||||
}
|
||||
|
||||
// InstallReadyzHandlerWithHealthyFunc is like InstallReadyzHandler, but in addition call firstTimeReady
|
||||
// the first time /readyz succeeds.
|
||||
func InstallReadyzHandlerWithHealthyFunc(mux mux, firstTimeReady func(), checks ...HealthChecker) {
|
||||
InstallPathHandlerWithHealthyFunc(mux, "/readyz", firstTimeReady, checks...)
|
||||
}
|
||||
|
||||
// InstallLivezHandler registers handlers for liveness checking on the path
|
||||
// "/livez" to mux. *All handlers* for mux must be specified in
|
||||
// exactly one call to InstallHandler. Calling InstallHandler more
|
||||
|
||||
Reference in New Issue
Block a user