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
+1 -1
View File
@@ -701,7 +701,7 @@ func (a *App) apply(r *Run, c ApplyConfigProvider) (bool, []error) {
// TODO Better way to detect diff on only filtered releases
{
changedReleases, planningErrs = st.DiffReleases(helm, c.Values(), c.Concurrency(), detailedExitCode, c.SuppressSecrets(), false, diffOpts)
changedReleases, planningErrs = st.DiffReleases(helm, c.Values(), c.Concurrency(), detailedExitCode, c.SuppressSecrets(), c.SuppressDiff(), false, diffOpts)
var err error
deletingReleases, err = st.DetectReleasesToBeDeletedForSync(helm, st.Releases)
+6 -1
View File
@@ -1895,6 +1895,7 @@ type applyConfig struct {
set []string
skipDeps bool
suppressSecrets bool
suppressDiff bool
noColor bool
context int
concurrency int
@@ -1922,6 +1923,10 @@ func (a applyConfig) SuppressSecrets() bool {
return a.suppressSecrets
}
func (a applyConfig) SuppressDiff() bool {
return a.suppressDiff
}
func (a applyConfig) NoColor() bool {
return a.noColor
}
@@ -2004,7 +2009,7 @@ func (helm *mockHelmExec) UpdateRepo() error {
func (helm *mockHelmExec) SyncRelease(context helmexec.HelmContext, name, chart string, flags ...string) error {
return nil
}
func (helm *mockHelmExec) DiffRelease(context helmexec.HelmContext, name, chart string, flags ...string) error {
func (helm *mockHelmExec) DiffRelease(context helmexec.HelmContext, name, chart string, suppressDiff bool, flags ...string) error {
return nil
}
func (helm *mockHelmExec) ReleaseStatus(context helmexec.HelmContext, release string, flags ...string) error {
+2
View File
@@ -41,6 +41,7 @@ type ApplyConfigProvider interface {
SkipDeps() bool
SuppressSecrets() bool
SuppressDiff() bool
NoColor() bool
Context() int
@@ -69,6 +70,7 @@ type DiffConfigProvider interface {
SkipDeps() bool
SuppressSecrets() bool
SuppressDiff() bool
DetailedExitcode() bool
NoColor() bool
+1 -1
View File
@@ -85,7 +85,7 @@ func (r *Run) Diff(c DiffConfigProvider) []error {
NoColor: c.NoColor(),
Set: c.Set(),
}
_, errs := st.DiffReleases(helm, c.Values(), c.Concurrency(), c.DetailedExitcode(), c.SuppressSecrets(), true, opts)
_, errs := st.DiffReleases(helm, c.Values(), c.Concurrency(), c.DetailedExitcode(), c.SuppressSecrets(), c.SuppressDiff(), true, opts)
return errs
}