@@ -62,6 +62,9 @@ func main() {
6262 var probeAddr string
6363 var secureMetrics bool
6464 var enableHTTP2 bool
65+
66+ config := controller.AppWrapperConfig {}
67+
6568 flag .StringVar (& metricsAddr , "metrics-bind-address" , ":8080" , "The address the metric endpoint binds to." )
6669 flag .StringVar (& probeAddr , "health-probe-bind-address" , ":8081" , "The address the probe endpoint binds to." )
6770 flag .BoolVar (& enableLeaderElection , "leader-elect" , false ,
@@ -71,6 +74,7 @@ func main() {
7174 "If set the metrics endpoint is served securely" )
7275 flag .BoolVar (& enableHTTP2 , "enable-http2" , false ,
7376 "If set, HTTP/2 will be enabled for the metrics and webhook servers" )
77+ flag .BoolVar (& config .ManageJobsWithoutQueueName , "manage-no-queue" , true , "Manage AppWrappers without queue names" )
7478 opts := zap.Options {
7579 Development : true ,
7680 }
@@ -131,6 +135,7 @@ func main() {
131135 if err := controller .WorkloadReconciler (
132136 mgr .GetClient (),
133137 mgr .GetEventRecorderFor ("kueue" ),
138+ jobframework .WithManageJobsWithoutQueueName (config .ManageJobsWithoutQueueName ),
134139 ).SetupWithManager (mgr ); err != nil {
135140 setupLog .Error (err , "Unable to create controller" , "controller" , "Workload" )
136141 os .Exit (1 )
@@ -139,13 +144,13 @@ func main() {
139144 if err = (& controller.AppWrapperReconciler {
140145 Client : mgr .GetClient (),
141146 Scheme : mgr .GetScheme (),
147+ Config : & config ,
142148 }).SetupWithManager (mgr ); err != nil {
143149 setupLog .Error (err , "unable to create controller" , "controller" , "AppWrapper" )
144150 os .Exit (1 )
145151 }
146152 if os .Getenv ("ENABLE_WEBHOOKS" ) != "false" {
147- // TODO: Proper configuration of ManageJobsWithoutQueueName via config file
148- wh := & controller.AppWrapperWebhook {ManageJobsWithoutQueueName : true }
153+ wh := & controller.AppWrapperWebhook {Config : & config }
149154 if err := ctrl .NewWebhookManagedBy (mgr ).
150155 For (& workloadv1beta2.AppWrapper {}).
151156 WithDefaulter (wh ).
0 commit comments