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:
yxxhero 2026-03-11 20:17:59 +08:00
parent e87ddd77f1
commit 2214b0ff8c
1 changed files with 3 additions and 2 deletions

View File

@ -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 {