Skip to content

Commit

Permalink
HIP: Default to strict Chart.yaml loading
Browse files Browse the repository at this point in the history
Signed-off-by: George Jenkins <[email protected]>
  • Loading branch information
gjenkins8 committed Nov 19, 2024
1 parent 71a5de3 commit f6da5f7
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions hips/hip-9999.md
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

0 comments on commit f6da5f7

Please sign in to comment.