DRA scheduler: fix feature gate check for PodSchedulingContext event

The event is only relevant when DRAControlPlaneController (= "classic DRA") is
enabled.

This change has no effect in practice because the only plugin using this event,
the dynamic resource plugin, also checks feature gates when asking for events
and correctly only asks for PodSchedulingContext events when
DRAControlPlaneController is enabled.
This commit is contained in:
Patrick Ohly 2024-08-20 10:49:08 +02:00
parent cb7b4ea648
commit 89e2feaf46

View File

@ -514,7 +514,7 @@ func addAllEventHandlers(
} }
handlers = append(handlers, handlerRegistration) handlers = append(handlers, handlerRegistration)
case framework.PodSchedulingContext: case framework.PodSchedulingContext:
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) { if utilfeature.DefaultFeatureGate.Enabled(features.DRAControlPlaneController) {
if handlerRegistration, err = informerFactory.Resource().V1alpha3().PodSchedulingContexts().Informer().AddEventHandler( if handlerRegistration, err = informerFactory.Resource().V1alpha3().PodSchedulingContexts().Informer().AddEventHandler(
buildEvtResHandler(at, framework.PodSchedulingContext, "PodSchedulingContext"), buildEvtResHandler(at, framework.PodSchedulingContext, "PodSchedulingContext"),
); err != nil { ); err != nil {