Add --skip-tests to helmfile template command (#2057)

* Add skip-tests to helmfile template command

* Fix formatting
This commit is contained in:
drivelikebrazil
2022-01-22 15:26:17 +09:00
committed by GitHub
parent 87e5903705
commit debd3c0eea
5 changed files with 20 additions and 0 deletions
+1
View File
@@ -1858,6 +1858,7 @@ func (a *App) template(r *Run, c TemplateConfigProvider) (bool, []error) {
IncludeCRDs: c.IncludeCRDs(),
OutputDirTemplate: c.OutputDirTemplate(),
SkipCleanup: c.SkipCleanup(),
SkipTests: c.SkipTests(),
}
return subst.TemplateReleases(helm, c.OutputDir(), c.Values(), args, c.Concurrency(), c.Validate(), opts)
}))
+5
View File
@@ -2268,6 +2268,7 @@ type configImpl struct {
skipCleanup bool
skipCRDs bool
skipDeps bool
skipTests bool
skipNeeds bool
includeNeeds bool
@@ -2310,6 +2311,10 @@ func (c configImpl) SkipNeeds() bool {
return c.skipNeeds
}
func (c configImpl) SkipTests() bool {
return c.skipTests
}
func (c configImpl) IncludeNeeds() bool {
return c.includeNeeds
}
+1
View File
@@ -177,6 +177,7 @@ type TemplateConfigProvider interface {
Validate() bool
SkipDeps() bool
SkipCleanup() bool
SkipTests() bool
OutputDir() string
IncludeCRDs() bool
IncludeNeeds() bool
+5
View File
@@ -1307,6 +1307,7 @@ type TemplateOpts struct {
SkipCleanup bool
OutputDirTemplate string
IncludeCRDs bool
SkipTests bool
}
type TemplateOpt interface{ Apply(*TemplateOpts) }
@@ -1385,6 +1386,10 @@ func (st *HelmState) TemplateReleases(helm helmexec.Interface, outputDir string,
flags = append(flags, "--include-crds")
}
if opts.SkipTests {
flags = append(flags, "--skip-tests")
}
if len(errs) == 0 {
if err := helm.TemplateRelease(release.Name, release.Chart, flags...); err != nil {
errs = append(errs, err)