Skip to content

Set NVIDIADriver status to NotReady on selector conflict#2289

Merged
rahulait merged 1 commit into
NVIDIA:mainfrom
rahulait:fix-status-on-conflict
Apr 15, 2026
Merged

Set NVIDIADriver status to NotReady on selector conflict#2289
rahulait merged 1 commit into
NVIDIA:mainfrom
rahulait:fix-status-on-conflict

Conversation

@rahulait

@rahulait rahulait commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Description

Problem

When two or more NVIDIADriver CRs have conflicting nodeSelectors (selecting overlapping sets of GPU nodes), the controller correctly detects this conflict during reconciliation and sets a condition on the affected CRs. However, the controller does not update status's state, leaving it unchanged.

This creates a misleading state where a previously ready NVIDIADriver remains visibly ready in kubectl get nvidiadriver output, even though:

  • A conflict condition prevents it from reconciling further
  • The driver cannot be modified until the conflict is resolved
  • The CR is effectively blocked/non-functional

Example:

$ kubectl get nvidiadriver
NAME         STATUS   AGE
default      ready    1h  # ← Still shows ready despite conflict!
nvd-gold     ready    1h  # ← Also shows ready despite conflict!

Root Cause

The conflict validation code (around line 144-151) only sets the conflict condition but does not update [status.state]. Other error branches in the same Reconcile() function correctly set [instance.Status.State = NotReady] before updating conditions. This inconsistency causes the status field to not reflect the actual state.

Solution

Set [instance.Status.State = nvidiav1alpha1.NotReady] in the conflict validation branch before calling SetConditionsError(), mirroring the behavior of other error paths.

After Fix:

$ kubectl get nvidiadriver
NAME         STATUS   AGE
default      notReady 1h  # ← Now correctly shows notReady
nvd-gold     notReady 1h  # ← Now correctly shows notReady

Users can now clearly see from kubectl get nvidiadriver that the CRs are blocked, and they can inspect [.status.conditions] to see the conflicting nodeselector reason.

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

Testing

Signed-off-by: Rahul Sharma <rahulsharm@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Apr 10, 2026

Copy link
Copy Markdown

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.

@rahulait

Copy link
Copy Markdown
Contributor Author

/ok to test 30e43f5

@rahulait
rahulait merged commit 6b74117 into NVIDIA:main Apr 15, 2026
19 checks passed
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.

3 participants