Summary
In controllers/argocd/applicationset.go, the condition checking whether SCMProviders is empty uses <= 0 instead of the more idiomatic == 0:
if len(appsetsSourceNamespaces) > 0 && (len(cr.Spec.ApplicationSet.SCMProviders) <= 0) {
also:
...fmt.Sprint(strings.Join(appsetsSourceNamespaces, ","))...
Since len() never returns a negative value, the <= 0 check should be replaced with == 0 for clarity and correctness.
Suggested Fix
if len(appsetsSourceNamespaces) > 0 && len(cr.Spec.ApplicationSet.SCMProviders) == 0 {
References
cc @nmirasch — you may want to pick this up as a small follow-up cleanup.
Summary
In
controllers/argocd/applicationset.go, the condition checking whetherSCMProvidersis empty uses<= 0instead of the more idiomatic== 0:also:
Since
len()never returns a negative value, the<= 0check should be replaced with== 0for clarity and correctness.Suggested Fix
References
cc @nmirasch — you may want to pick this up as a small follow-up cleanup.