Skip to content

Commit

Permalink
Merge pull request #1223 from gab-satchi/webhook-readiness
Browse files Browse the repository at this point in the history
Wait for webhook readiness and healthy
  • Loading branch information
k8s-ci-robot committed Oct 19, 2021
2 parents e135a76 + 414234e commit 381fc8a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.go
Expand Up @@ -27,7 +27,6 @@ import (

"k8s.io/klog/v2"
"k8s.io/klog/v2/klogr"
"sigs.k8s.io/controller-runtime/pkg/healthz"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"
ctrlmgr "sigs.k8s.io/controller-runtime/pkg/manager"
ctrlsig "sigs.k8s.io/controller-runtime/pkg/manager/signals"
Expand Down Expand Up @@ -233,12 +232,12 @@ func main() {
}

func setupChecks(mgr ctrlmgr.Manager) {
if err := mgr.AddReadyzCheck("ping", healthz.Ping); err != nil {
if err := mgr.AddReadyzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil {
setupLog.Error(err, "unable to create ready check")
os.Exit(1)
}

if err := mgr.AddHealthzCheck("ping", healthz.Ping); err != nil {
if err := mgr.AddHealthzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil {
setupLog.Error(err, "unable to create health check")
os.Exit(1)
}
Expand Down

0 comments on commit 381fc8a

Please sign in to comment.