feat: helmfile template --skip-cleanup (#1570)

* feat: `helmfile template --skip-cleanup`

Resolves #1517
This commit is contained in:
Yusuke Kuoka
2020-11-06 09:23:49 +09:00
committed by GitHub
parent 5a15b65b94
commit 88884b68dc
7 changed files with 64 additions and 10 deletions
+5 -1
View File
@@ -218,6 +218,9 @@ func (a *App) Diff(c DiffConfigProvider) error {
}
func (a *App) Template(c TemplateConfigProvider) error {
opts := []LoadOption{SetRetainValuesFiles(c.SkipCleanup())}
return a.ForEachState(func(run *Run) (ok bool, errs []error) {
// `helm template` in helm v2 does not support local chart.
// So, we set forceDownload=true for helm v2 only
@@ -233,7 +236,7 @@ func (a *App) Template(c TemplateConfigProvider) error {
}
return
})
}, opts...)
}
func (a *App) WriteValues(c WriteValuesConfigProvider) error {
@@ -1437,6 +1440,7 @@ func (a *App) template(r *Run, c TemplateConfigProvider) (bool, []error) {
Set: c.Set(),
IncludeCRDs: c.IncludeCRDs(),
OutputDirTemplate: c.OutputDirTemplate(),
SkipCleanup: c.SkipCleanup(),
}
return subst.TemplateReleases(helm, c.OutputDir(), c.Values(), args, c.Concurrency(), c.Validate(), opts)
}))
+5
View File
@@ -2241,6 +2241,7 @@ type configImpl struct {
set []string
output string
includeCRDs bool
skipCleanup bool
skipDeps bool
}
@@ -2264,6 +2265,10 @@ func (c configImpl) Validate() bool {
return true
}
func (c configImpl) SkipCleanup() bool {
return c.skipCleanup
}
func (c configImpl) SkipDeps() bool {
return c.skipDeps
}
+1
View File
@@ -134,6 +134,7 @@ type TemplateConfigProvider interface {
OutputDirTemplate() string
Validate() bool
SkipDeps() bool
SkipCleanup() bool
OutputDir() string
IncludeCRDs() bool