Skip to content

Commit

Permalink
Start waiting for certs to be ready before sending data to the channel (
Browse files Browse the repository at this point in the history
#2209)

Start waiting for certs to be ready before sending data to the channel

Signed-off-by: Yuki Iwai <[email protected]>
  • Loading branch information
tenzen-y committed Aug 16, 2023
1 parent bc5add9 commit ec2b8e8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/katib-controller/v1beta1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ func main() {
ctx := signals.SetupSignalHandler()
certsReady := make(chan struct{})
defer close(certsReady)

// The setupControllers will register controllers to the manager
// after generated certs for the admission webhooks.
go setupControllers(mgr, certsReady, hookServer)

if initConfig.CertGeneratorConfig.Enable {
if err = cert.AddToManager(mgr, initConfig.CertGeneratorConfig, certsReady); err != nil {
log.Error(err, "Failed to set up cert-generator")
Expand All @@ -144,10 +149,6 @@ func main() {
certsReady <- struct{}{}
}

// The setupControllers will register controllers to the manager
// after generated certs for the admission webhooks.
go setupControllers(mgr, certsReady, hookServer)

log.Info("Setting up health checker.")
if err := mgr.AddReadyzCheck("readyz", hookServer.StartedChecker()); err != nil {
log.Error(err, "Unable to add readyz endpoint to the manager")
Expand Down

0 comments on commit ec2b8e8

Please sign in to comment.