Skip to content

Commit

Permalink
Fix Unmarshall of the shared-deps for linting
Browse files Browse the repository at this point in the history
Use strict to make sure we have the proper Dependency

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Apr 12, 2021
1 parent 26700a8 commit 8582bb0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/lint/rules/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func validateChartHypperSharedDeps(chart *helmChart.Metadata) error {
func validateChartHypperSharedDepsCorrect(chart *helmChart.Metadata) error {
depList := chart.Annotations["hypper.cattle.io/shared-dependencies"]
var yamlDeps []*helmChart.Dependency
if err := yaml.Unmarshal([]byte(depList), &yamlDeps); err != nil {
if err := yaml.UnmarshalStrict([]byte(depList), &yamlDeps); err != nil {
return errors.New("Shared dependencies list is broken, please check the correct format")
}
return nil
Expand Down
3 changes: 2 additions & 1 deletion pkg/lint/rules/testdata/badchartbrokenhypperdeps/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ appVersion: "1.16.0"
annotations:
"hypper.cattle.io/release-name": "release"
"hypper.cattle.io/namespace": "namespace"
"hypper.cattle.io/shared-dependencies": "jojo"
"hypper.cattle.io/shared-dependencies": |
- what: ever
2 changes: 1 addition & 1 deletion pkg/lint/rules/testdata/goodchart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ annotations:
"hypper.cattle.io/release-name": "release"
"hypper.cattle.io/namespace": "namespace"
"hypper.cattle.io/shared-dependencies": |
- key: value
- name: shareddep

0 comments on commit 8582bb0

Please sign in to comment.