feat: Reset values flag (#602)

Ref https://github.com/helmfile/helmfile/discussions/593

* implemented --reset-values flag overriding .helmDefaults.reuseValues=true
* tests for --reset-values flag
* fixed pkg/app tests
* added tests for both reset & reuse flags given
* added appendValuesControlMode method for --reuse/reset-values flag processing
* updated code comments & docs

Signed-off-by: Karol Ossowski <k@koralsky.pl>
This commit is contained in:
koralsky
2023-01-17 09:34:37 +09:00
committed by GitHub
parent c4eb62388b
commit fc634c9ee3
13 changed files with 122 additions and 15 deletions
+10 -1
View File
@@ -38,6 +38,8 @@ type DiffOptions struct {
Output string
// ReuseValues is true if the helm command should reuse the values
ReuseValues bool
// ResetValues is true if helm command should reset values to charts' default
ResetValues bool
}
// NewDiffOptions creates a new Apply
@@ -160,5 +162,12 @@ func (t *DiffImpl) SuppressSecrets() bool {
// ReuseValues returns the ReuseValues.
func (t *DiffImpl) ReuseValues() bool {
return t.DiffOptions.ReuseValues
if !t.ResetValues() {
return t.DiffOptions.ReuseValues
}
return false
}
func (t *DiffImpl) ResetValues() bool {
return t.DiffOptions.ResetValues
}