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 08:42:54 +09:00
committed by GitHub
parent 5abbdea059
commit 5fb037c8e3
+5
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)