Skip to content

Commit

Permalink
revert the setting of healthz
Browse files Browse the repository at this point in the history
  • Loading branch information
mimowo committed Jan 31, 2024
1 parent b43f8ab commit 35d4f0a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cmd/kueue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

configapi "sigs.k8s.io/kueue/apis/config/v1beta1"
Expand Down Expand Up @@ -274,15 +275,13 @@ func setupControllers(mgr ctrl.Manager, cCache *cache.Cache, queues *queue.Manag
func setupProbeEndpoints(mgr ctrl.Manager) {
defer setupLog.Info("Probe endpoints are configured on healthz and readyz")

readyz := func(req *http.Request) error {
return mgr.GetWebhookServer().StartedChecker()(req)
}

if err := mgr.AddHealthzCheck("healthz", readyz); err != nil {
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
os.Exit(1)
}
if err := mgr.AddReadyzCheck("readyz", readyz); err != nil {
if err := mgr.AddReadyzCheck("readyz", func(req *http.Request) error {
return mgr.GetWebhookServer().StartedChecker()(req)
}); err != nil {
setupLog.Error(err, "unable to set up ready check")
os.Exit(1)
}
Expand Down

0 comments on commit 35d4f0a

Please sign in to comment.