mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
merge2: preserve explicitly set null values
Fixed bug where an explicitly set null value in yaml was cleared, even when the patch did not operate on that field.
This commit is contained in:
@@ -732,6 +732,50 @@ spec:
|
||||
protocol: "TCP"
|
||||
- containerPort: 8301
|
||||
protocol: "UDP"
|
||||
`,
|
||||
},
|
||||
|
||||
// Issue #4628
|
||||
"should retain existing null values in targets": {
|
||||
input: `
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: chart
|
||||
spec:
|
||||
releaseName: helm-chart
|
||||
timeout: 15m
|
||||
values:
|
||||
chart:
|
||||
replicaCount: null
|
||||
autoscaling: true
|
||||
`,
|
||||
patch: yaml.MustParse(`
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: chart
|
||||
spec:
|
||||
releaseName: helm-chart
|
||||
timeout: 15m
|
||||
values:
|
||||
deepgram-api:
|
||||
some: value
|
||||
`),
|
||||
expected: `
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: chart
|
||||
spec:
|
||||
releaseName: helm-chart
|
||||
timeout: 15m
|
||||
values:
|
||||
chart:
|
||||
replicaCount: null
|
||||
autoscaling: true
|
||||
deepgram-api:
|
||||
some: value
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user