fix: using correct option for takeOwnership flag

Fixed test to correctly assert the new flag
This commit is contained in:
Adam Blasko 2025-01-22 23:12:30 +01:00 committed by GitHub
parent 2b9ed46b32
commit 0c688471ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -155,7 +155,7 @@ func (st *HelmState) appendTakeOwnershipFlags(flags []string, helm helmexec.Inte
return flags return flags
} }
switch { switch {
case ops.HideNotes: case ops.TakeOwnership:
flags = append(flags, "--take-ownership") flags = append(flags, "--take-ownership")
} }
return flags return flags

View File

@ -340,18 +340,18 @@ func TestAppendTakeOwnershipFlags(t *testing.T) {
flags: []string{}, flags: []string{},
helm: testutil.NewVersionHelmExec("3.16.0"), helm: testutil.NewVersionHelmExec("3.16.0"),
opt: &SyncOpts{ opt: &SyncOpts{
HideNotes: true, TakeOwnership: true,
}, },
expected: []string{}, expected: []string{},
}, },
}, },
{ {
name: "hide-notes from cmd flag", name: "take-ownership from cmd flag",
args: args{ args: args{
flags: []string{}, flags: []string{},
helm: testutil.NewVersionHelmExec("3.17.0"), helm: testutil.NewVersionHelmExec("3.17.0"),
opt: &SyncOpts{ opt: &SyncOpts{
HideNotes: true, TakeOwnership: true,
}, },
expected: []string{"--take-ownership"}, expected: []string{"--take-ownership"},
}, },