reconcile all nvidiadrivers when any nvidiadriver is changed#2258
reconcile all nvidiadrivers when any nvidiadriver is changed#2258rahulait wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
bf127d3 to
44050bf
Compare
44050bf to
6497fe8
Compare
|
/ok to test 6497fe8 |
|
This mostly looks good to me, Rahul. Have you tested the case where instead of deleting the default CR, you edit it to narrow the scope to limit overlap with a new, custom CR? |
Yup, I tested this scenario as well and it works fine. Tested by having 3 node cluster with default nvd, then adding two more nvds targetting individual nodes and then limiting scope of default to one node. All nvds were able to bring up drivers correctly on each node. |
Signed-off-by: Rahul Sharma <rahulsharm@nvidia.com>
6497fe8 to
8e5fc42
Compare
|
/ok to test 8e5fc42 |
|
This is out of scope for this PR, but we should introduce some integration tests for NVIDIADriver CR if we don't have them already. I was looking at the test suite and ideally we could have tests of the end-to-end scenario. Otherwise, looks good to me (based on what we've already discussed on Option 1 vs 2). |
Description
Fixes: #2259
Issue
When multiple NVIDIADriver CRs exist, conflict validation is global (overlapping node selection across all driver CRs). A common case is the default CR (no nodeSelector) selecting all GPU nodes, which blocks custom CRs with targeted selectors.
Blocked CRs currently exit reconcile from the validation path with no requeue, so they remain stuck until an external event re-triggers them.
Deleting the conflicting default CR changes global validity, but previously only the deleted object was enqueued by the primary watch, so remaining CRs were not retried immediately.
Options Considered
Option 1 (implemented):
On NVIDIADriver events, enqueue reconcile for all NVIDIADriver CRs via TypedEnqueueRequestsFromMapFunc (fan-out).
Option 2 (not implemented):
Return error from validation failure so each conflicting CR self-requeues via the rate-limiter.
Basically here. switch from nil to error:
gpu-operator/controllers/nvidiadriver_controller.go
Line 151 in d5750f2
Why Option 1
Why Option 2 is less useful
Expected Outcome
After removing a conflicting NVIDIADriver (for example, deleting default CR), remaining previously blocked CRs are automatically revalidated and can proceed without manual nudges.
Checklist
make lint)make validate-generated-assets)make validate-modules)Testing