Skip to content

Commit c6136b6

Browse files
committed
HIP: Default to strict Chart.yaml loading
Signed-off-by: George Jenkins <[email protected]>
1 parent 71a5de3 commit c6136b6

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

hips/hip-9999.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
hip: 9999
3+
title: "Default to strict `Chart.yaml` loading"
4+
authors: [ "George Jenkins <[email protected]>" ]
5+
created: "2024-11-18"
6+
type: "feature"
7+
status: "draft"
8+
---
9+
10+
## Abstract
11+
12+
Helm should default to using strict-mode yaml loading for loading charts ie. `yaml.UnmarshalStrict(..)` rather than `yaml.Unmarshal(..)`.
13+
14+
15+
## Motivation
16+
17+
Currently Helm loads chart's Chart.yaml in "non-strict" yaml loading mode.
18+
The main consequence of this behavior is that Helm ignores unknown and duplicate fields in `Chart.yaml`.
19+
Either unknown to the present version of Helm, or simply user typos.
20+
The result is that the behavior the user expects from Helm as described by these unknown/duplicate fields is effectively ignored.
21+
Presenting a confusing experience to the user.
22+
23+
24+
## Specification
25+
26+
Helm will default to using strict-mode yaml loading for loading charts ie. ie. `yaml.UnmarshalStrict(..)` rather than `yaml.Unmarshal(..)`.
27+
28+
The CLI/SDK will contain an option to allow non-strict loading.
29+
This is to allow users to continue to utilize charts that are malformed.
30+
31+
32+
## Backwards compatibility
33+
34+
Helm 4 allows breaking behavioral changes.
35+
However it is a core premise that Helm 4 will remain compatibility with existing chart.
36+
Moving to strict mode for loading yaml will prevent charts from being loaded that contain unknown/invalid fields.
37+
Requiring a command line flag / SDK option allows fallback compatibility if required.
38+
39+
## Security implications
40+
41+
N/A
42+
43+
44+
## How to teach this
45+
46+
Update `Chart.yaml` docs
47+
48+
49+
## Reference implementation
50+
51+
See PR links in [References](#references)
52+
53+
54+
## References
55+
56+
- \[chart/loader\] use strict yaml unmarshaling for chart files <https://github.com/helm/helm/pull/11818>
57+
- fix(pkg/lint): unmarshals Chart.yaml strictly <https://github.com/helm/helm/pull/12382>
58+
- [HIP-9999][hip-9999] ("Forward compatibility: `Chart.yaml` `minimumHelmVersion`"), for a complementary HIP that allows further tightening of Helm's forward compatibility behavior.
59+
60+
[hip-9999]: ./hip-9999.md
61+

0 commit comments

Comments
 (0)