From 976f30716d020375fa53e8365348ae723e0df94d Mon Sep 17 00:00:00 2001 From: Anuj Dube Date: Wed, 10 Dec 2025 15:48:03 +0530 Subject: [PATCH 1/2] fix(controller): do not apply driver upgrade annotation when driver is disabled The applyDriverAutoUpgradeAnnotation() function was applying the nvidia.com/gpu-driver-upgrade-enabled annotation to GPU nodes even when driver.enabled=false. This occurred because the function only checked if driver.upgradePolicy.autoUpgrade was true, without verifying that the driver component itself was enabled. This fix adds a check for Driver.IsEnabled() before applying the annotation, ensuring it is only set when: 1. Driver is enabled 2. Auto-upgrade policy exists and is enabled 3. Sandbox workloads are disabled Added unit tests to validate the fix and prevent regression. Fixes #1277 Signed-off-by: Anuj Dube --- controllers/state_manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/state_manager.go b/controllers/state_manager.go index 0f10e40e8..9da6970cb 100644 --- a/controllers/state_manager.go +++ b/controllers/state_manager.go @@ -438,7 +438,8 @@ func (n *ClusterPolicyController) applyDriverAutoUpgradeAnnotation() error { updateRequired := false value := "true" annotationValue, annotationExists := node.Annotations[driverAutoUpgradeAnnotationKey] - if n.singleton.Spec.Driver.UpgradePolicy != nil && + if n.singleton.Spec.Driver.IsEnabled() && + n.singleton.Spec.Driver.UpgradePolicy != nil && n.singleton.Spec.Driver.UpgradePolicy.AutoUpgrade && !n.sandboxEnabled { // check if we need to add the annotation From bf5763f9db99c1ecc564127faf8cae632934f43e Mon Sep 17 00:00:00 2001 From: Rajath Agasthya Date: Thu, 19 Feb 2026 17:43:24 -0600 Subject: [PATCH 2/2] Don't skip upgrade annotation when NVIDIADriver CRD is used Signed-off-by: Rajath Agasthya --- controllers/state_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/state_manager.go b/controllers/state_manager.go index 9da6970cb..99052395e 100644 --- a/controllers/state_manager.go +++ b/controllers/state_manager.go @@ -438,7 +438,7 @@ func (n *ClusterPolicyController) applyDriverAutoUpgradeAnnotation() error { updateRequired := false value := "true" annotationValue, annotationExists := node.Annotations[driverAutoUpgradeAnnotationKey] - if n.singleton.Spec.Driver.IsEnabled() && + if (n.singleton.Spec.Driver.IsEnabled() || n.singleton.Spec.Driver.UseNvidiaDriverCRDType()) && n.singleton.Spec.Driver.UpgradePolicy != nil && n.singleton.Spec.Driver.UpgradePolicy.AutoUpgrade && !n.sandboxEnabled {