Skip to content

Commit cd7201c

Browse files
author
Benjamin Ritter
committedJan 20, 2025
fix: add upstream TLS check to readiness probe
Signed-off-by: Benjamin Ritter <benjamin.ritter@stackit.cloud>
1 parent 8b6b614 commit cd7201c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎main.go

+10
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,16 @@ func innerMain() int {
312312
}
313313
}
314314

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

0 commit comments

Comments
 (0)