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
}
switch {
case ops.HideNotes:
case ops.TakeOwnership:
flags = append(flags, "--take-ownership")
}
return flags

View File

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