@@ -236,10 +236,17 @@ func waitForRayClusterAPIandSetupController(ctx context.Context, mgr ctrl.Manage
236
236
func setupAppWrapperComponents (ctx context.Context , cancel context.CancelFunc , mgr ctrl.Manager ,
237
237
cfg * config.CodeFlareOperatorConfiguration , certsReady chan struct {}) error {
238
238
if cfg .AppWrapper == nil || ! ptr .Deref (cfg .AppWrapper .Enabled , false ) {
239
- setupLog .Info ("AppWrapper controller disabled by config " )
239
+ setupLog .Info ("AppWrappers are disabled by operator configuration " )
240
240
return nil
241
241
}
242
242
243
+ // AppWrapper webhook doesn't depend on WorkloadAPI availablity but does need certsReady
244
+ go func () {
245
+ <- certsReady
246
+ setupLog .Info ("Setting up AppWrapper webhook" )
247
+ exitOnError (awctrl .SetupWebhooks (mgr , cfg .AppWrapper .Config ), "unable to setup AppWrapper webhooks" )
248
+ }()
249
+
243
250
if isAPIAvailable (ctx , mgr , workloadAPI ) {
244
251
setupLog .Info ("Workload API available; enabling AppWrappers" )
245
252
go setupAppWrapperController (mgr , cfg , certsReady )
@@ -260,10 +267,7 @@ func setupAppWrapperComponents(ctx context.Context, cancel context.CancelFunc, m
260
267
func setupAppWrapperController (mgr ctrl.Manager , cfg * config.CodeFlareOperatorConfiguration , certsReady chan struct {}) {
261
268
setupLog .Info ("Waiting for certificate generation to complete" )
262
269
<- certsReady
263
- setupLog .Info ("Certs ready" )
264
-
265
- setupLog .Info ("Setting up AppWrapper webhook and controller" )
266
- exitOnError (awctrl .SetupWebhooks (mgr , cfg .AppWrapper .Config ), "unable to setup AppWrapper webhooks" )
270
+ setupLog .Info ("Setting up AppWrapper controller" )
267
271
exitOnError (awctrl .SetupControllers (mgr , cfg .AppWrapper .Config ), "unable to setup AppWrapper controller" )
268
272
}
269
273
0 commit comments