From cfd6037b0343ee103a8e1ca17e04b09805a71f6f Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Fri, 11 Oct 2024 12:25:22 +0200 Subject: [PATCH] DRA: Update resourceslice controller filtering logic The logic has been updated to ensure that a controller started for non-node-local resources filters out all resourceslices created for node-local resources. Without this change, a single driver with both node-local and non-node-local resources would end up in a constant battle of creating and deleting node-local resource slices in the controller it setup for its non-node-local resources. This change fixes that. Signed-off-by: Kevin Klues --- .../resourceslice/resourceslicecontroller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/resourceslicecontroller.go b/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/resourceslicecontroller.go index 2c7d2c2a557..ca320eee97c 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/resourceslicecontroller.go +++ b/staging/src/k8s.io/dynamic-resource-allocation/resourceslice/resourceslicecontroller.go @@ -198,7 +198,10 @@ func (c *Controller) initInformer(ctx context.Context) error { logger := klog.FromContext(ctx) // We always filter by driver name, by node name only for node-local resources. - selector := fields.Set{resourceapi.ResourceSliceSelectorDriver: c.driver} + selector := fields.Set{ + resourceapi.ResourceSliceSelectorDriver: c.driver, + resourceapi.ResourceSliceSelectorNodeName: "", + } if c.owner.APIVersion == "v1" && c.owner.Kind == "Node" { selector[resourceapi.ResourceSliceSelectorNodeName] = c.owner.Name }