Skip to content

Commit 0cac6ca

Browse files
committed
AppWrapper webhook can be registered without Kueue APIs
1 parent 3b3fa8d commit 0cac6ca

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

main.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,17 @@ func waitForRayClusterAPIandSetupController(ctx context.Context, mgr ctrl.Manage
236236
func setupAppWrapperComponents(ctx context.Context, cancel context.CancelFunc, mgr ctrl.Manager,
237237
cfg *config.CodeFlareOperatorConfiguration, certsReady chan struct{}) error {
238238
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")
240240
return nil
241241
}
242242

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+
243250
if isAPIAvailable(ctx, mgr, workloadAPI) {
244251
setupLog.Info("Workload API available; enabling AppWrappers")
245252
go setupAppWrapperController(mgr, cfg, certsReady)
@@ -260,10 +267,7 @@ func setupAppWrapperComponents(ctx context.Context, cancel context.CancelFunc, m
260267
func setupAppWrapperController(mgr ctrl.Manager, cfg *config.CodeFlareOperatorConfiguration, certsReady chan struct{}) {
261268
setupLog.Info("Waiting for certificate generation to complete")
262269
<-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")
267271
exitOnError(awctrl.SetupControllers(mgr, cfg.AppWrapper.Config), "unable to setup AppWrapper controller")
268272
}
269273

0 commit comments

Comments
 (0)