Add option to suppress diff on apply (#1092)

* Add option to suppress diff on apply

Add --supress-diff option on apply. Usable for fresh installs when a
lot of output is produces by diff.

Resolves #458

* fix tests for suppress-diff
This commit is contained in:
Emil
2020-02-05 21:29:55 +09:00
committed by GitHub
parent 757e748e3f
commit 05add478c1
11 changed files with 32 additions and 15 deletions
+5 -3
View File
@@ -255,7 +255,7 @@ func (helm *execer) TemplateRelease(name string, chart string, flags ...string)
return err
}
func (helm *execer) DiffRelease(context HelmContext, name, chart string, flags ...string) error {
func (helm *execer) DiffRelease(context HelmContext, name, chart string, suppressDiff bool, flags ...string) error {
helm.logger.Infof("Comparing release=%v, chart=%v", name, chart)
preArgs := context.GetTillerlessArgs(helm)
env := context.getTillerlessEnv()
@@ -273,11 +273,13 @@ func (helm *execer) DiffRelease(context HelmContext, name, chart string, flags .
switch e := err.(type) {
case ExitError:
if e.ExitStatus() == 2 {
helm.write(out)
if !(suppressDiff) {
helm.write(out)
}
return err
}
}
} else {
} else if !(suppressDiff) {
helm.write(out)
}
return err