-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIP: Default to strict
Chart.yaml
loading
Signed-off-by: George Jenkins <[email protected]>
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
hip: 9999 | ||
title: "Default to strict `Chart.yaml` loading" | ||
authors: [ "George Jenkins <[email protected]>" ] | ||
created: "2024-11-18" | ||
type: "feature" | ||
status: "draft" | ||
--- | ||
|
||
## Abstract | ||
|
||
Helm should default to using strict-mode yaml loading for loading charts ie. `yaml.UnmarshalStrict(..)` rather than `yaml.Unmarshal(..)`. | ||
|
||
|
||
## Motivation | ||
|
||
Currently Helm loads chart's Chart.yaml in "non-strict" yaml loading mode. | ||
The main consequence of this behavior is that Helm ignores unknown and duplicate fields in `Chart.yaml`. | ||
Either unknown to the present version of Helm, or simply typos. | ||
In that the behavior the user expects from Helm as described by unknown fields is effectively ignored. | ||
Presenting a confusing experience to the user. | ||
|
||
|
||
## Rationale | ||
|
||
Also see: [HIP-9999][hip-9999] ("Forward compatibility: `Chart.yaml` `minimumHelmVersion`"), for a complementary HIP that allows further tightening of Helm's forward compatibility behavior. | ||
|
||
|
||
## Specification | ||
|
||
Helm will default to using strict-mode yaml loading for loading charts ie. ie. `yaml.UnmarshalStrict(..)` rather than `yaml.Unmarshal(..)`. | ||
|
||
The CLI/SDK will contain an option to allow non-strict loading. | ||
This is to allow users to continue to utilize charts that are malformed. | ||
|
||
|
||
## Backwards compatibility | ||
|
||
Helm 4 allows breaking behavioral changes. | ||
However it is a core premise that Helm 4 will remain compatibility with existing chart. | ||
Moving to strict mode for loading yaml will prevent charts from being loaded that contain unknown/invalid fields. | ||
Requiring a command line flag / SDK option allows fallback compatibility if required. | ||
|
||
## Security implications | ||
|
||
N/A | ||
|
||
|
||
## How to teach this | ||
|
||
Update `Chart.yaml` docs | ||
|
||
|
||
## Reference implementation | ||
|
||
See PR links in [References] | ||
|
||
|
||
## References | ||
|
||
- \[chart/loader\] use strict yaml unmarshaling for chart files <https://github.com/helm/helm/pull/11818> | ||
- fix(pkg/lint): unmarshals Chart.yaml strictly <https://github.com/helm/helm/pull/12382> | ||
|
||
[hip-9999]: ./hip-9999.md |