mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-19 13:42:52 +02:00
feat: helmfile template --skip-cleanup (#1570)
* feat: `helmfile template --skip-cleanup` Resolves #1517
This commit is contained in:
+5
-1
@@ -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)
|
||||
}))
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ type TemplateConfigProvider interface {
|
||||
OutputDirTemplate() string
|
||||
Validate() bool
|
||||
SkipDeps() bool
|
||||
SkipCleanup() bool
|
||||
OutputDir() string
|
||||
IncludeCRDs() bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user