Skip to content

fix(recipe): handle null override in mergeValues to delete keys#458

Merged
mchmarny merged 2 commits into
NVIDIA:mainfrom
Jont828:fix/mergevalues-null-override
Mar 31, 2026
Merged

fix(recipe): handle null override in mergeValues to delete keys#458
mchmarny merged 2 commits into
NVIDIA:mainfrom
Jont828:fix/mergevalues-null-override

Conversation

@Jont828

@Jont828 Jont828 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • mergeValues did not handle nil (YAML null) values — overlays setting emptyDir: null to remove the base Prometheus emptyDir storage config stored the nil value instead of deleting the key
  • This produced emptyDir: null in generated Helm values, which the Prometheus CRD rejected at deploy time with: spec.storage.emptyDir: Invalid value: "null"
  • Added nil-check that deletes the key from dst when src value is nil, aligning with RFC 7396 (JSON Merge Patch) semantics used by Helm and Kustomize

Affects all cloud provider overlays (AKS, EKS, GKE) that override Prometheus storage from emptyDir to PVC-backed storage.

Test plan

  • Added "null override deletes key" table-driven test case covering the Prometheus emptyDir → volumeClaimTemplate scenario
  • go test -race ./pkg/recipe/... -run TestMergeValues passes
  • make qualify passes in CI
  • Verify generated bundle for AKS/EKS/GKE no longer contains emptyDir: null

mergeValues did not handle nil (YAML null) values, so overlays using
emptyDir: null to remove the base Prometheus emptyDir storage config
would store the nil value instead of deleting the key. This produced
emptyDir: null in the generated Helm values, which the Prometheus CRD
rejected at deploy time. Add nil-check that deletes the key from dst
when src value is nil, aligning with RFC 7396 (JSON Merge Patch)
semantics.

Signed-off-by: Jonathan Tong <[email protected]>
Signed-off-by: Jont828 <[email protected]>
@Jont828 Jont828 requested a review from a team as a code owner March 23, 2026 22:45
@copy-pr-bot

copy-pr-bot Bot commented Mar 23, 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.

@dims

dims commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

/ok to test 60d190b

@mchmarny mchmarny enabled auto-merge (squash) March 31, 2026 16:37
@mchmarny mchmarny merged commit 173dba5 into NVIDIA:main Mar 31, 2026
15 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since it has been closed for 90 days with no further activity. Please open a new pull request for related changes.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants