@@ -237,10 +237,17 @@ func waitForRayClusterAPIandSetupController(ctx context.Context, mgr ctrl.Manage
237237func setupAppWrapperComponents (ctx context.Context , cancel context.CancelFunc , mgr ctrl.Manager ,
238238 cfg * config.CodeFlareOperatorConfiguration , certsReady chan struct {}) error {
239239 if cfg .AppWrapper == nil || ! ptr .Deref (cfg .AppWrapper .Enabled , false ) {
240- setupLog .Info ("AppWrapper controller disabled by config " )
240+ setupLog .Info ("AppWrappers are disabled by operator configuration " )
241241 return nil
242242 }
243243
244+ // AppWrapper webhook doesn't depend on WorkloadAPI availablity but does need certsReady
245+ go func () {
246+ <- certsReady
247+ setupLog .Info ("Setting up AppWrapper webhook" )
248+ exitOnError (awctrl .SetupWebhooks (mgr , cfg .AppWrapper .Config ), "unable to setup AppWrapper webhooks" )
249+ }()
250+
244251 if isAPIAvailable (ctx , mgr , workloadAPI ) {
245252 setupLog .Info ("Workload API available; enabling AppWrappers" )
246253 go setupAppWrapperController (mgr , cfg , certsReady )
@@ -261,10 +268,7 @@ func setupAppWrapperComponents(ctx context.Context, cancel context.CancelFunc, m
261268func setupAppWrapperController (mgr ctrl.Manager , cfg * config.CodeFlareOperatorConfiguration , certsReady chan struct {}) {
262269 setupLog .Info ("Waiting for certificate generation to complete" )
263270 <- certsReady
264- setupLog .Info ("Certs ready" )
265-
266- setupLog .Info ("Setting up AppWrapper webhook and controller" )
267- exitOnError (awctrl .SetupWebhooks (mgr , cfg .AppWrapper .Config ), "unable to setup AppWrapper webhooks" )
271+ setupLog .Info ("Setting up AppWrapper controller" )
268272 exitOnError (awctrl .SetupControllers (mgr , cfg .AppWrapper .Config ), "unable to setup AppWrapper controller" )
269273}
270274
0 commit comments