refactor: check ops nil before Helm version in appendHideNotesFlags
- Swap the order to check ops == nil first to avoid unnecessary IsVersionAtLeast call - Restore the "see Helm release" comment for consistency with other flag helpers Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
parent
e87ddd77f1
commit
2214b0ff8c
|
|
@ -257,10 +257,11 @@ func (st *HelmState) appendCascadeFlags(flags []string, helm helmexec.Interface,
|
|||
|
||||
// append hide-notes flags to helm flags
|
||||
func (st *HelmState) appendHideNotesFlags(flags []string, helm helmexec.Interface, ops *SyncOpts) []string {
|
||||
if !helm.IsVersionAtLeast("3.16.0") {
|
||||
if ops == nil {
|
||||
return flags
|
||||
}
|
||||
if ops == nil {
|
||||
// see https://github.com/helm/helm/releases/tag/v3.16.0
|
||||
if !helm.IsVersionAtLeast("3.16.0") {
|
||||
return flags
|
||||
}
|
||||
switch {
|
||||
|
|
|
|||
Loading…
Reference in New Issue