mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
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 <kklues@nvidia.com>
This commit is contained in:
parent
426aa3d6ce
commit
cfd6037b03
@ -198,7 +198,10 @@ func (c *Controller) initInformer(ctx context.Context) error {
|
|||||||
logger := klog.FromContext(ctx)
|
logger := klog.FromContext(ctx)
|
||||||
|
|
||||||
// We always filter by driver name, by node name only for node-local resources.
|
// 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" {
|
if c.owner.APIVersion == "v1" && c.owner.Kind == "Node" {
|
||||||
selector[resourceapi.ResourceSliceSelectorNodeName] = c.owner.Name
|
selector[resourceapi.ResourceSliceSelectorNodeName] = c.owner.Name
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user