Merge pull request #594 from sstarcher/fetch_devel

fix: Fetch devel

Fixes two issues encountered in https://sweetops.slack.com/archives/CE5NGCB9Q/p1557848927155400
This commit is contained in:
KUOKA Yusuke 2019-05-15 08:55:54 +09:00 committed by GitHub
commit 9eec72b318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -340,6 +340,9 @@ func (e *Error) Error() string {
} else { } else {
msgs := []string{} msgs := []string{}
for i, err := range e.Errors { for i, err := range e.Errors {
if err == nil {
continue
}
msgs = append(msgs, fmt.Sprintf("err %d: %v", i, err.Error())) msgs = append(msgs, fmt.Sprintf("err %d: %v", i, err.Error()))
} }
cause = fmt.Sprintf("%d errors:\n%s", len(e.Errors), strings.Join(msgs, "\n")) cause = fmt.Sprintf("%d errors:\n%s", len(e.Errors), strings.Join(msgs, "\n"))

View File

@ -450,6 +450,10 @@ func (st *HelmState) downloadCharts(helm helmexec.Interface, dir string, concurr
chartPath = path.Join(dir, release.Name, "latest", release.Chart) chartPath = path.Join(dir, release.Name, "latest", release.Chart)
} }
if st.isDevelopment(release) {
fetchFlags = append(fetchFlags, "--devel")
}
// only fetch chart if it is not already fetched // only fetch chart if it is not already fetched
if _, err := os.Stat(chartPath); os.IsNotExist(err) { if _, err := os.Stat(chartPath); os.IsNotExist(err) {
fetchFlags = append(fetchFlags, "--untar", "--untardir", chartPath) fetchFlags = append(fetchFlags, "--untar", "--untardir", chartPath)
@ -463,7 +467,6 @@ func (st *HelmState) downloadCharts(helm helmexec.Interface, dir string, concurr
chartPath = filepath.Dir(fullChartPath) chartPath = filepath.Dir(fullChartPath)
} }
} }
results <- &downloadResults{release.Name, chartPath} results <- &downloadResults{release.Name, chartPath}
} }
}, },