CLI 'argocd admin cluster stats' doesn't work with round-robin
Checklist:
- [x ] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- [ x] I've included steps to reproduce the bug.
- [ x] I've pasted the output of
argocd version.
Describe the bug
I do not see the statistics correctly when the cluster uses the round robin algorithm.
The application controller works correctly with round robin (at least I can see round robin in logs.) but argocd cli admin cluster stats not.
To Reproduce
- Install argocd
- Config argocd with 3 replicas in application controllers and algorithm of sharding: round-robin
- Login with argocd cli into cluster argocd
- Run: argocd admin cluster stats
Values:
crds:
install: true
keep: true
global:
logging:
level: debug
params:
controller.sharding.algorithm: "round-robin"
controller:
replicas: 3
Expected behavior
I hope to see the values of shards correctly.
Screenshots
Application controller log:
Version
argocd: v2.9.3+6eba5be
BuildDate: 2023-12-01T23:24:09Z
GitCommit: 6eba5be864b7e031871ed7698f5233336dfe75c7
GitTreeState: clean
GoVersion: go1.21.4
Compiler: gc
Platform: linux/amd64
argocd-server: v2.9.3+6eba5be
BuildDate: 2023-12-01T23:05:50Z
GitCommit: 6eba5be864b7e031871ed7698f5233336dfe75c7
GitTreeState: clean
GoVersion: go1.21.3
Compiler: gc
Platform: linux/amd64
Kustomize Version: v5.2.1 2023-10-19T20:13:51Z
Helm Version: v3.13.2+g2a2fb3b
Kubectl Version: v0.24.2
Jsonnet Version: v0.20.0
Logs argocd cli
INFO[0000] Starting configmap/secret informers
INFO[0000] Configmap/secret informer synced
INFO[0000] Using filter function: legacy
INFO[0000] Cluster with uid: d7b3dddc-3fa9-4794-8275-720a0c36e206 will be processed by shard 0
SERVER SHARD CONNECTION NAMESPACES COUNT APPS COUNT RESOURCES COUNT
https://kubernetes.default.svc 0 0 0 0
I have been see the code of argocd and I can find the following lines: https://github.com/argoproj/argo-cd/blob/v2.9.3/cmd/argocd/commands/admin/cluster.go#L125C77-L125C101 common.DefaultShardingAlgorithm = LegacyShardingAlgorithm LegacyShardingAlgorithm = "legacy" https://github.com/argoproj/argo-cd/blob/v2.9.3/common/common.go#L118C5-L118C5
does this mean that "admin cluster stats" doesn't work with any other algorithm than "legacy"?
Also, when I have configured the algorithm as legacy, I can see the same information (zero shard, zero apps).
I got the same error.
Hello, I would like to work on this issue.