Skip to content

fix(controller): do not apply driver upgrade annotation when driver is disabled#1981

Open
anujdbe wants to merge 1 commit intoNVIDIA:mainfrom
anujdbe:fix/driver-upgrade-annotation-when-driver-disabled
Open

fix(controller): do not apply driver upgrade annotation when driver is disabled#1981
anujdbe wants to merge 1 commit intoNVIDIA:mainfrom
anujdbe:fix/driver-upgrade-annotation-when-driver-disabled

Conversation

@anujdbe
Copy link

@anujdbe anujdbe commented Dec 10, 2025

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

…s 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 NVIDIA#1277

Signed-off-by: Anuj Dube <anujdubesn@gmail.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 10, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rajathagasthya
Copy link
Contributor

/ok-to-test b0249cf

}

// Simulate the logic from applyDriverAutoUpgradeAnnotation
shouldApply := clusterPolicy.Spec.Driver.IsEnabled() &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the tests add much value if we're just duplicating logic here. You will need to either call applyDriverAutoUpgradeAnnotation() with appropriate fake client/objects set up (preferred) or remove the test entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nvidia.com/gpu-driver-upgrade-enabled: "true" even when the driver.enabled=false

2 participants