Fix crash on missing chart (#1087)

When chart is not set, an exception without any hints occure due
normalizeChart tries to access the first character of a 0 length string.
Properly inform user of missing chart.
This commit is contained in:
Daniel Poelzleithner 2020-02-03 00:42:54 +01:00 committed by GitHub
parent 5abbdea059
commit 5fb037c8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -1424,6 +1424,11 @@ func (st *HelmState) BuildDeps(helm helmexec.Interface) []error {
errs := []error{}
for _, release := range st.Releases {
if len(release.Chart) == 0 {
errs = append(errs, errors.New("chart is required for: "+release.Name))
continue
}
if isLocalChart(release.Chart) {
if err := helm.BuildDeps(release.Name, normalizeChart(st.basePath, release.Chart)); err != nil {
errs = append(errs, err)