feat: Integrate device plugin registration gRPC server health checks.

This commit is contained in:
zhangzhifei16
2024-10-30 13:26:17 +08:00
committed by zhifei92
parent e5a31e8bbc
commit 1381e41f28
13 changed files with 104 additions and 12 deletions

View File

@@ -59,6 +59,12 @@ func WithWatchdogClient(watchdog WatchdogClient) Option {
}
}
func WithExtendedCheckers(checkers []healthz.HealthChecker) Option {
return func(hc *healthChecker) {
hc.checkers = append(hc.checkers, checkers...)
}
}
type healthChecker struct {
checkers []healthz.HealthChecker
retryBackoff wait.Backoff
@@ -109,7 +115,7 @@ func NewHealthChecker(syncLoop syncLoopHealthChecker, opts ...Option) (HealthChe
Jitter: 0.1,
Steps: 2,
}
hc.checkers = checkers
hc.checkers = append(hc.checkers, checkers...)
hc.retryBackoff = retryBackoff
hc.interval = watchdogVal / 2