feat: helmfile template (#284)

`helmfile template` runs `helm template` over releases within the helmfiles, and provide you a stream of generated yaml documents of Kubernetes resources via stdout.

Resolves #283
This commit is contained in:
Karl Stoney
2018-09-04 11:31:43 +09:00
committed by KUOKA Yusuke
parent 8a90e5320c
commit 93c5d4c219
5 changed files with 177 additions and 5 deletions
+8 -1
View File
@@ -6,9 +6,10 @@ import (
"os"
"strings"
"sync"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"sync"
)
const (
@@ -143,6 +144,12 @@ func (helm *execer) DecryptSecret(name string) (string, error) {
return tmpFile.Name(), err
}
func (helm *execer) TemplateRelease(chart string, flags ...string) error {
out, err := helm.exec(append([]string{"template", chart}, flags...)...)
helm.write(out)
return err
}
func (helm *execer) DiffRelease(name, chart string, flags ...string) error {
helm.logger.Infof("Comparing %v %v", name, chart)
out, err := helm.exec(append([]string{"diff", "upgrade", "--allow-unreleased", name, chart}, flags...)...)