Honor GPUCluster DaemonSet update strategy #2958
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
<a href="https://app.coderabbit.ai/change-stack/NVIDIA/gpu-operator/pull/2958?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a>
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
<!-- review_stack_entry_end -->
<details>
<summary>🧰 Additional context used</summary>
<details>
<summary>📚 Code guidelines (1)</summary>
AGENTS.md — auto-discovered
</details>
</details>
<!-- recent_review_start -->
No actionable comments were generated in the recent review. 🎉
<details>
<summary>ℹ️ Recent review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
fbbbb923-20fc-4a82-b706-9b6af1791ce6</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between 4fdfb1db7ddb87ba8969c52c634a5aeff104ab5f and 1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34.
</details>
<details>
<summary>📒 Files selected for processing (5)</summary>
internal/state/configurable_state.go
internal/state/daemonsets_test.go
internal/state/dra_driver.go
internal/state/gpucluster.go
internal/state/state_skel_test.go</details>
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
</details>
---
<!-- recent_review_end -->
<!-- walkthrough_start -->
<details>
<summary>📝 Walkthrough</summary>
Walkthrough
GPUCluster component render paths now use a shared renderer that applies the configured DaemonSet update strategy. An empty strategy defaults to RollingUpdate. OnDelete removes rollingUpdate settings. Tests cover strategy output across four states, newly rendered operands, and DaemonSet readiness under both strategies.
</details>
<!-- walkthrough_end -->
<!-- change_assessment_start -->
Priority: ➖ Normal
<!-- change_assessment_commit:"1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34" -->
Severity of issue fixed: Medium
<!-- change_assessment_end -->
<!-- final_review_risk_start -->
Merge Risk: _⚪ Minimal_ · up to 1ff82
<!-- final_review_risk_coverage:{"sourceCommitId":"1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34","coveredCommitId":"1ff825b8a1ceb3eb63beef9525ac0d1d7ee19a34","kind":"reviewed"} -->
The strategy and readiness changes have no identified merge-blocking issue. The existing operand defaults and OnDelete readiness checks should remain as implemented.
<!-- final_review_risk_end -->
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- tips_start -->
---
<sub>Comment @coderabbitai help to get the list of available commands.</sub>
<!-- tips_end -->
This is not correct. We should be updating the yaml templates to set the daemonset update strategy
Thanks @tariq1890. I moved this into the shared renderer following the discussion in #2957 so future GPUCluster DaemonSets would inherit the same update-strategy handling. If I understand your point correctly, the templates should express the desired DaemonSet spec directly, without a second step that overrides it in Go. That makes sense to me. I have moved the handling back into the four templates while preserving the existing defaults and regression coverage.
tariq1890
ajavanma
Description
Fixes https://github.com/NVIDIA/gpu-operator/issues/2957
GPUCluster accepts
daemonsets.updateStrategy: OnDelete, but its DRA kubelet plugin, DRA validator, DCGM and DCGM exporter DaemonSets always renderRollingUpdate. This can allow automatic pod replacement when the administrator requested manual replacement.Render the configured update strategy directly in the four YAML templates using the existing
Daemonsetsrender data. Omitted configuration still selectsRollingUpdate. The DRA templates omit the completerollingUpdateblock forOnDelete, preservingmaxUnavailable: "100%"for rolling updates. DCGM and DCGM exporter preserve their existing rolling-update defaults.Readiness remains desired-state convergence: all desired pods must use the current template and be available. An OnDelete workload stays NotReady until manual replacement finishes; later operand states continue reconciling. No production readiness, API, dependency or NVIDIADriver changes.
Checklist
GOOS=linux make lint; static analysis on macOS)make validate-generated-assets) — not rerun; no API, generated-code or Helm changesmake validate-modules) — not rerun; no dependency changesTesting
3bdad2e3a5cbb3a54129a728f6f6339e14be4764; the retained renderer matrix adds four explicit RollingUpdate-with-settings controls.make fmt,make license-checkandmake unit-testpassed with Go 1.27.1 on macOS ARM64, including the full build and all 21 tested packages.GOOS=linux make lintpassed with zero issues using golangci-lint 2.13.1 and Go 1.27.1 on the Mac. This was static analysis for Linux, not Linux runtime testing.