Skip to content

Commit 573400b

Browse files
Wei WengWei Weng
authored andcommitted
explain the behavior of AddReadyzCheck
Signed-off-by: Wei Weng <[email protected]>
1 parent 091e019 commit 573400b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/hubagent/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ func main() {
172172
// Add webhook readiness check AFTER controllers are set up (when ResourceInformer is initialized)
173173
// This prevents webhook from accepting requests before discovery cache is populated
174174
if opts.EnableWebhook {
175+
// AddReadyzCheck adds additional readiness check instead of replacing the one registered earlier provided the name is different.
176+
// Both registered checks need to pass for the manager to be considered ready.
175177
if err := mgr.AddReadyzCheck("webhook-cache", webhook.ResourceInformerReadinessChecker(validator.ResourceInformer)); err != nil {
176178
klog.ErrorS(err, "unable to set up webhook readiness check")
177179
exitWithErrorFunc()

0 commit comments

Comments
 (0)