@@ -25,23 +25,23 @@ import (
25
25
"k8s.io/apiserver/pkg/server/healthz"
26
26
)
27
27
28
- // AddHealthzCheck adds HealthzCheck(s) to both healthz and readyz. All healthz checks
28
+ // AddHealthChecks adds HealthzCheck(s) to both healthz and readyz. All healthz checks
29
29
// are automatically added to readyz, since we want to avoid the situation where the
30
30
// apiserver is ready but not live.
31
- func (s * GenericAPIServer ) AddHealthzChecks (checks ... healthz.HealthzChecker ) error {
31
+ func (s * GenericAPIServer ) AddHealthChecks (checks ... healthz.HealthChecker ) error {
32
32
return s .AddDelayedHealthzChecks (0 , checks ... )
33
33
}
34
34
35
35
// AddReadyzChecks allows you to add a HealthzCheck to readyz.
36
- func (s * GenericAPIServer ) AddReadyzChecks (checks ... healthz.HealthzChecker ) error {
36
+ func (s * GenericAPIServer ) AddReadyzChecks (checks ... healthz.HealthChecker ) error {
37
37
s .readyzLock .Lock ()
38
38
defer s .readyzLock .Unlock ()
39
39
return s .addReadyzChecks (checks ... )
40
40
}
41
41
42
42
// addReadyzChecks allows you to add a HealthzCheck to readyz.
43
43
// premise: readyzLock has been obtained
44
- func (s * GenericAPIServer ) addReadyzChecks (checks ... healthz.HealthzChecker ) error {
44
+ func (s * GenericAPIServer ) addReadyzChecks (checks ... healthz.HealthChecker ) error {
45
45
if s .readyzChecksInstalled {
46
46
return fmt .Errorf ("unable to add because the readyz endpoint has already been created" )
47
47
}
@@ -94,7 +94,7 @@ func (c shutdownCheck) Check(req *http.Request) error {
94
94
// grace period has not yet elapsed. One may want to set a grace period in order to prevent
95
95
// the kubelet from restarting the kube-apiserver due to long-ish boot sequences. Readyz health
96
96
// checks have no grace period, since we want readyz to fail while boot has not completed.
97
- func (s * GenericAPIServer ) AddDelayedHealthzChecks (delay time.Duration , checks ... healthz.HealthzChecker ) error {
97
+ func (s * GenericAPIServer ) AddDelayedHealthzChecks (delay time.Duration , checks ... healthz.HealthChecker ) error {
98
98
s .healthzLock .Lock ()
99
99
defer s .healthzLock .Unlock ()
100
100
if s .healthzChecksInstalled {
@@ -110,7 +110,7 @@ func (s *GenericAPIServer) AddDelayedHealthzChecks(delay time.Duration, checks .
110
110
}
111
111
112
112
// delayedHealthCheck wraps a health check which will not fail until the explicitly defined delay has elapsed.
113
- func delayedHealthCheck (check healthz.HealthzChecker , clock clock.Clock , delay time.Duration ) healthz.HealthzChecker {
113
+ func delayedHealthCheck (check healthz.HealthChecker , clock clock.Clock , delay time.Duration ) healthz.HealthChecker {
114
114
return delayedHealthzCheck {
115
115
check ,
116
116
clock .Now ().Add (delay ),
@@ -119,7 +119,7 @@ func delayedHealthCheck(check healthz.HealthzChecker, clock clock.Clock, delay t
119
119
}
120
120
121
121
type delayedHealthzCheck struct {
122
- check healthz.HealthzChecker
122
+ check healthz.HealthChecker
123
123
startCheck time.Time
124
124
clock clock.Clock
125
125
}
0 commit comments