File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -349,12 +349,13 @@ func main() {
349
349
350
350
autoscalingOpts := flags .AutoscalingOptions ()
351
351
352
- // If the DRA flag is passed, we need to set the DRA feature gate as well. The selection of scheduler plugins for the default
353
- // scheduling profile depends on feature gates, and the DRA plugin is only included if the DRA feature gate is enabled. The DRA
354
- // plugin itself also checks the DRA feature gate and doesn't do anything if it's not enabled.
355
- if autoscalingOpts .DynamicResourceAllocationEnabled && ! featureGate .Enabled (features .DynamicResourceAllocation ) {
356
- if err := featureGate .SetFromMap (map [string ]bool {string (features .DynamicResourceAllocation ): true }); err != nil {
357
- klog .Fatalf ("couldn't enable the DRA feature gate: %v" , err )
352
+ // The DRA feature controls whether the DRA scheduler plugin is selected in scheduler framework. The local DRA flag controls whether
353
+ // DRA logic is enabled in Cluster Autoscaler. The 2 values should be in sync - enabling DRA logic in CA without selecting the DRA scheduler
354
+ // plugin doesn't actually do anything, and selecting the DRA scheduler plugin without enabling DRA logic in CA means the plugin is not set up
355
+ // correctly and can panic.
356
+ if autoscalingOpts .DynamicResourceAllocationEnabled != featureGate .Enabled (features .DynamicResourceAllocation ) {
357
+ if err := featureGate .SetFromMap (map [string ]bool {string (features .DynamicResourceAllocation ): autoscalingOpts .DynamicResourceAllocationEnabled }); err != nil {
358
+ klog .Fatalf ("couldn't set the DRA feature gate to %v: %v" , autoscalingOpts .DynamicResourceAllocationEnabled , err )
358
359
}
359
360
}
360
361
You can’t perform that action at this time.
0 commit comments