Skip to content

Commit

Permalink
panic with clear message (helm#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
itscaro authored Mar 9, 2021
1 parent 927bd30 commit 3215eaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1989,11 +1989,14 @@ func markExcludedReleases(releases []ReleaseSpec, selectors []string, commonLabe
return nil, fmt.Errorf("Condition value must be in the form 'foo.enabled' where 'foo' can be modified as necessary")
}
if v, ok := values[conditionSplit[0]]; ok {
if v == nil {
panic(fmt.Sprintf("environment values field '%s' is nil", conditionSplit[0]))
}
if v.(map[string]interface{})["enabled"] == true {
conditionMatch = true
}
} else {
panic(fmt.Sprintf("environment values does not contain field %s", conditionSplit[0]))
panic(fmt.Sprintf("environment values does not contain field '%s'", conditionSplit[0]))
}
}
res := Release{
Expand Down

0 comments on commit 3215eaf

Please sign in to comment.