From 66de674e0e8ae69240748da5f18d1d9c8d43631e Mon Sep 17 00:00:00 2001 From: Michael Aspinwall Date: Fri, 11 Jul 2025 20:49:15 +0000 Subject: [PATCH] fix: Delete singleton links if they are removed Currently if a link is deleted as the last link the driver will never reconcile and leave it in the resource slice. Ensure that this does not happen since that could lead to bad assignments by the scheduler. --- pkg/inventory/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/inventory/db.go b/pkg/inventory/db.go index 4c7c3cad..af79724e 100644 --- a/pkg/inventory/db.go +++ b/pkg/inventory/db.go @@ -57,6 +57,7 @@ type DB struct { rateLimiter *rate.Limiter notifications chan []resourceapi.Device + hasDevices bool } func New() *DB { @@ -176,7 +177,8 @@ func (db *DB) Run(ctx context.Context) error { } klog.V(4).Infof("Found %d devices", len(devices)) - if len(devices) > 0 { + if len(devices) > 0 || db.hasDevices { + db.hasDevices = len(devices) > 0 db.notifications <- devices } select {