feat: add --take-ownership flag to helm diff and related config (#1992)

* feat: add --take-ownership flag to helm diff and related config

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix: nil issue

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix tests

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix tests

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix more issue

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix more issues

Signed-off-by: yxxhero <aiopsclub@163.com>

* fix tests

Signed-off-by: yxxhero <aiopsclub@163.com>

* add more tests

Signed-off-by: yxxhero <aiopsclub@163.com>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2025-04-27 12:57:41 -04:00
committed by GitHub
parent 6b5f1496a8
commit c3864a45d3
11 changed files with 117 additions and 24 deletions
+2
View File
@@ -1390,6 +1390,7 @@ func (a *App) apply(r *Run, c ApplyConfigProvider) (bool, bool, []error) {
PostRendererArgs: c.PostRendererArgs(),
SkipSchemaValidation: c.SkipSchemaValidation(),
SuppressOutputLineRegex: c.SuppressOutputLineRegex(),
TakeOwnership: c.TakeOwnership(),
}
infoMsg, releasesToBeUpdated, releasesToBeDeleted, errs := r.diff(false, detailedExitCode, c, diffOpts)
@@ -1634,6 +1635,7 @@ func (a *App) diff(r *Run, c DiffConfigProvider) (*string, bool, bool, []error)
PostRendererArgs: c.PostRendererArgs(),
SkipSchemaValidation: c.SkipSchemaValidation(),
SuppressOutputLineRegex: c.SuppressOutputLineRegex(),
TakeOwnership: c.TakeOwnership(),
}
filtered := &Run{
+1
View File
@@ -157,6 +157,7 @@ type DiffConfigProvider interface {
NoColor() bool
Context() int
DiffOutput() string
TakeOwnership() bool
concurrencyConfig
valuesControlMode
+4
View File
@@ -46,6 +46,7 @@ type diffConfig struct {
skipSchemaValidation bool
reuseValues bool
logger *zap.SugaredLogger
takeOwnership bool
}
func (a diffConfig) Args() string {
@@ -183,6 +184,9 @@ func (a diffConfig) SkipSchemaValidation() bool {
func (a diffConfig) SuppressOutputLineRegex() []string {
return a.suppressOutputLineRegex
}
func (a diffConfig) TakeOwnership() bool {
return a.takeOwnership
}
func TestDiff(t *testing.T) {
type flags struct {