Skip to content

Commit

Permalink
fix(lint): use correct hash key for rendered tmpl
Browse files Browse the repository at this point in the history
The YAML validation was broken because the renderedContentMap has keys
with the path to the template including the chart directory, whereas the
linter was trying to access it relative from the chart directory.

For example, the hash key was `drupal/templates/deployment.yaml` but the
linter was trying to access `templates/deployment.yaml`. This commit
fixes the key used to access the rendered content.
  • Loading branch information
Adnan Abdulhussein committed Oct 14, 2016
1 parent a324146 commit d81ac48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lint/rules/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func Templates(linter *support.Linter) {
// NOTE, disabled for now, Refs https://github.com/kubernetes/helm/issues/1037
// linter.RunLinterRule(support.WarningSev, path, validateQuotes(string(preExecutedTemplate)))

renderedContent := renderedContentMap[fileName]
renderedContent := renderedContentMap[filepath.Join(chart.GetMetadata().Name, fileName)]
var yamlStruct K8sYamlStruct
// Even though K8sYamlStruct only defines Metadata namespace, an error in any other
// key will be raised as well
Expand Down

0 comments on commit d81ac48

Please sign in to comment.