feat: add helmfile template --validate (#1135)

This adds the ability for helmfile to call `helm template --validate` introduced in helm 3.

fixes #1105
This commit is contained in:
KUOKA Yusuke
2020-03-05 08:07:02 +09:00
committed by GitHub
parent 7c80a859fa
commit bf22502a2f
5 changed files with 24 additions and 2 deletions
+5 -1
View File
@@ -760,7 +760,7 @@ func (o *TemplateOpts) Apply(opts *TemplateOpts) {
}
// TemplateReleases wrapper for executing helm template on the releases
func (st *HelmState) TemplateReleases(helm helmexec.Interface, outputDir string, additionalValues []string, args []string, workerLimit int, opt ...TemplateOpt) []error {
func (st *HelmState) TemplateReleases(helm helmexec.Interface, outputDir string, additionalValues []string, args []string, workerLimit int, validate bool, opt ...TemplateOpt) []error {
opts := &TemplateOpts{}
for _, o := range opt {
o.Apply(opts)
@@ -832,6 +832,10 @@ func (st *HelmState) TemplateReleases(helm helmexec.Interface, outputDir string,
os.Mkdir(releaseOutputDir, 0755)
}
if validate {
flags = append(flags, "--validate")
}
if len(errs) == 0 {
if err := helm.TemplateRelease(release.Name, temp[release.Name], flags...); err != nil {
errs = append(errs, err)