Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deployments/gpu-operator/templates/nvidiadriver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ spec:
{{- if .Values.driver.licensingConfig.secretName }}
licensingConfig:
secretName: {{ .Values.driver.licensingConfig.secretName }}
nlsEnabled: {{ .Values.driver.licensingConfig.nlsEnabled | default true }}
nlsEnabled: {{ if hasKey .Values.driver.licensingConfig "nlsEnabled" }}{{ .Values.driver.licensingConfig.nlsEnabled }}{{ else }}true{{ end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Empty licensing override breaks driver upgrades

With an empty nlsEnabled override, hasKey renders a blank value instead of the previous true. The NVIDIADriver CRD requires a boolean, so Helm cannot apply the resource.

Learn more

The chart accepts Helm overrides for licensing settings. Helm's --set-string driver.licensingConfig.nlsEnabled= leaves a present key with an empty string, so hasKey takes the value branch and produces nlsEnabled: with a null YAML value. The NVIDIADriver schema requires a boolean. The previous default true treated the empty string as missing and produced valid YAML. Both licensing source branches use the same new expression.

Example: An install with driver.licensingConfig.secretName=license and driver.licensingConfig.nlsEnabled= rendered nlsEnabled: true before this change. On upgrade it renders nlsEnabled: and Kubernetes rejects the NVIDIADriver.

Recommended fix: Preserve false explicitly while treating empty or null overrides as unset in both branches; add render checks for false and empty values.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

{{- else if .Values.driver.licensingConfig.configMapName }}
licensingConfig:
name: {{ .Values.driver.licensingConfig.configMapName }}
nlsEnabled: {{ .Values.driver.licensingConfig.nlsEnabled | default true }}
nlsEnabled: {{ if hasKey .Values.driver.licensingConfig "nlsEnabled" }}{{ .Values.driver.licensingConfig.nlsEnabled }}{{ else }}true{{ end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Licensing fix lacks a regression test

Both nlsEnabled branches change behavior without a regression test. Automated checks cannot catch a return to rendering explicit false as true.

Learn more

This bug fix changes rendering in both licensing source branches, but the PR contains no new test. Testing conventions explicitly require a regression test that fails without a bug fix, and the chart is the supported installation path.

Example: If either branch reverts to default true, an explicit nlsEnabled=false silently becomes true again; a Helm rendering test that asserts the output for both sources would fail.

Recommended fix: Add automated rendering checks for secretName and configMapName, each with explicit false and default true, and wire them into the repository's test workflow.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

{{- end }}
{{- if .Values.driver.virtualTopology.config }}
virtualTopologyConfig:
Expand Down