Skip to content

Commit 5b973ad

Browse files
Benjamin Ritterl0wl3vel
Benjamin Ritter
authored andcommitted
fix: add upstream TLS check to readiness probe
Signed-off-by: Benjamin Ritter <benjamin.ritter@stackit.cloud>
1 parent 45f7bd3 commit 5b973ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,16 @@ func innerMain() int {
309309
}
310310
}
311311

312+
// Always enable downstream checking for the webhooks, if enabled.
313+
if len(webhooks) > 0 {
314+
tlsChecker := webhook.NewTLSChecker(*certDir, *port)
315+
setupLog.Info("setting up TLS readiness probe")
316+
if err := mgr.AddReadyzCheck("tls-check", tlsChecker); err != nil {
317+
setupLog.Error(err, "unable to create tls readiness check")
318+
return 1
319+
}
320+
}
321+
312322
// Setup controllers asynchronously, they will block for certificate generation if needed.
313323
setupErr := make(chan error)
314324
ctx := ctrl.SetupSignalHandler()

0 commit comments

Comments
 (0)