Skip to content

Commit e697402

Browse files
authored
Merge pull request #2629 from sedefsavas/reverthealthz
Remove webhook health check
2 parents 4259d83 + 9df2a87 commit e697402

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

controlplane/eks/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import (
4747
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
4848
ctrl "sigs.k8s.io/controller-runtime"
4949
"sigs.k8s.io/controller-runtime/pkg/controller"
50+
"sigs.k8s.io/controller-runtime/pkg/healthz"
5051
// +kubebuilder:scaffold:imports
5152
)
5253

@@ -201,12 +202,12 @@ func main() {
201202

202203
// +kubebuilder:scaffold:builder
203204

204-
if err := mgr.AddReadyzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil {
205+
if err := mgr.AddReadyzCheck("ping", healthz.Ping); err != nil {
205206
setupLog.Error(err, "unable to create ready check")
206207
os.Exit(1)
207208
}
208209

209-
if err := mgr.AddHealthzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil {
210+
if err := mgr.AddHealthzCheck("ping", healthz.Ping); err != nil {
210211
setupLog.Error(err, "unable to create health check")
211212
os.Exit(1)
212213
}

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import (
5151
clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4"
5252
ctrl "sigs.k8s.io/controller-runtime"
5353
"sigs.k8s.io/controller-runtime/pkg/controller"
54+
"sigs.k8s.io/controller-runtime/pkg/healthz"
5455
// +kubebuilder:scaffold:imports
5556
)
5657

@@ -240,12 +241,12 @@ func main() {
240241

241242
// +kubebuilder:scaffold:builder
242243

243-
if err := mgr.AddReadyzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil {
244+
if err := mgr.AddReadyzCheck("ping", healthz.Ping); err != nil {
244245
setupLog.Error(err, "unable to create ready check")
245246
os.Exit(1)
246247
}
247248

248-
if err := mgr.AddHealthzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil {
249+
if err := mgr.AddHealthzCheck("ping", healthz.Ping); err != nil {
249250
setupLog.Error(err, "unable to create health check")
250251
os.Exit(1)
251252
}

0 commit comments

Comments
 (0)