Fix --skip-cleanup to work with chartify (#1860)

This commit is contained in:
Yusuke Kuoka 2021-05-24 08:30:58 +09:00 committed by GitHub
parent c881544255
commit 97bab23e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -237,6 +237,7 @@ func (a *App) Template(c TemplateConfigProvider) error {
SkipRepos: c.SkipDeps(),
SkipDeps: c.SkipDeps(),
IncludeCRDs: &includeCRDs,
SkipCleanup: c.SkipCleanup(),
}, func() {
ok, errs = a.template(run, c)
})
@ -390,6 +391,7 @@ func (a *App) Apply(c ApplyConfigProvider) error {
Wait: c.Wait(),
WaitForJobs: c.WaitForJobs(),
IncludeCRDs: &includeCRDs,
SkipCleanup: c.RetainValuesFiles() || c.SkipCleanup(),
}, func() {
matched, updated, es := a.apply(run, c)

View File

@ -964,6 +964,7 @@ type ChartPrepareOptions struct {
SkipRepos bool
SkipDeps bool
SkipResolve bool
SkipCleanup bool
IncludeCRDs *bool
Wait bool
WaitForJobs bool
@ -1108,7 +1109,9 @@ func (st *HelmState) PrepareCharts(helm helmexec.Interface, dir string, concurre
isLocal := st.directoryExistsAt(normalizeChart(st.basePath, chartName))
chartification, clean, err := st.PrepareChartify(helm, release, chartPath, workerIndex)
defer clean()
if !opts.SkipCleanup {
defer clean()
}
if err != nil {
results <- &chartPrepareResult{err: err}
return