Skip to content

Commit

Permalink
bugfix:(#11391) helm lint infinite loop
Browse files Browse the repository at this point in the history
 when malformed template object

Signed-off-by: wujunwei <wjw3323@live.com>
(cherry picked from commit 316d3fb)
  • Loading branch information
wujunwei authored and mattfarina committed Jun 14, 2023
1 parent 524a0e7 commit 5217482
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/lint/rules/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@ func Templates(linter *support.Linter, values map[string]interface{}, namespace
break
}

// If YAML linting fails, we sill progress. So we don't capture the returned state
// on this linter run.
linter.RunLinterRule(support.ErrorSev, fpath, validateYamlContent(err))

// If YAML linting fails, it will always be fails next block. so we should return here.
// fix https://github.com/helm/helm/issues/11391
if !linter.RunLinterRule(support.ErrorSev, fpath, validateYamlContent(err)) {
return
}
if yamlStruct != nil {
// NOTE: set to warnings to allow users to support out-of-date kubernetes
// Refs https://github.com/helm/helm/issues/8596
Expand Down

0 comments on commit 5217482

Please sign in to comment.