mirror of https://github.com/helm/helm
Add lint rule to detect duplicate keys in values.yaml. This addresses the issue where Helm allows installing charts with invalid YAML that contains duplicate keys, which silently takes the last value. Changes: - Add ReadValuesFileStrict and ReadValuesStrict functions in pkg/chart/common/values.go that use yaml.UnmarshalStrict - Add validateValuesFileDuplicateKeys function in both v2 and v3 lint rules to check for duplicate keys - Add test data with duplicate keys for both v2 and v3 - Add tests to verify duplicate key detection works Closes #31102 Signed-off-by: Kartik Suryavanshi <158498247+KartikSuryavanshi@users.noreply.github.com>pull/32363/head
parent
187a02298a
commit
65c3fc7581
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v3
|
||||||
|
name: duplicatekeys
|
||||||
|
description: testing chart with duplicate keys in values.yaml
|
||||||
|
version: 0.1.0
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
invalid:
|
||||||
|
duplicate: default
|
||||||
|
duplicate: value-i-want
|
||||||
|
duplicate: last-one
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: duplicatekeys
|
||||||
|
description: testing chart with duplicate keys in values.yaml
|
||||||
|
version: 0.1.0
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
invalid:
|
||||||
|
duplicate: default
|
||||||
|
duplicate: value-i-want
|
||||||
|
duplicate: last-one
|
||||||
Loading…
Reference in new issue