argo-cd
argo-cd copied to clipboard
argocd CLI admin cluster generate spec does not work in v2.4.9
Describe the bug
When executing argocd admin cluster generate-spec clustername
an error is printed instead of the cluster config. This used to work in an older version of argocd CLI.
To Reproduce
$ export KUBECONFIG=~/.kube/my-cluster
$ argocd admin cluster generate-spec azure-eu-v2 |yq eval '.stringData.config' -|jq|yq eval - -P
FATA[0000] configmap "argocd-cm" not found
null
$ argocd version
argocd: v2.4.11+3d9e9f2.dirty
BuildDate: 2022-08-22T12:52:04Z
GitCommit: 3d9e9f2f95b7801b90377ecfc4073e5f0f07205b
GitTreeState: dirty
GoVersion: go1.19
Compiler: gc
Platform: linux/amd64
FATA[0000] Argo CD server address unspecified
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://RREDACTED
name: my-cluster
contexts:
- context:
cluster: my-cluster
user: my-cluster-admin
name: my-cluster-admin@my-cluster
current-context: my-cluster-admin@my-cluster
kind: Config
preferences: {}
users:
- name: my-cluster-admin
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
Expected behavior
$ argocd version
argocd: v2.2.11+aa3f374
BuildDate: 2022-07-12T16:13:20Z
GitCommit: aa3f3749f8d5f174d2e4cdd2cf14cf6f9ef55143
GitTreeState: clean
GoVersion: go1.16.11
Compiler: gc
Platform: linux/amd64
FATA[0000] Argo CD server address unspecified
$ export KUBECONFIG=~/.kube/my-cluster
$ argocd admin cluster generate-spec azure-eu-v2 |yq eval '.stringData.config' -|jq|yq eval - -P
tlsClientConfig:
insecure: false
certData: REDACTED
keyData: REDACTED
caData: REDACTED
I was struggling with the same thing, but managed to solve it. Try first calling
argocd login --core
Then you can verify that argocd version
and argocd cluster add xxx
no longer produce the error "Argo CD server address unspecified".
I'm sorry - maybe the issue description wasn't clear enough. The issue is not with argocd version
, or argocd cluster add
, or the error Argo CD server address unspecified
.
Instead, the issue is about argocd admin cluster generate-spec context
not working, and erroring with FATA[0000] configmap "argocd-cm" not found
. This works (still) in older (2.2.x) versions of the CLI but not in the newest (2.4.x) versions.
same here with argocd admin cluster generate-spec
FATA[0001] configmap "argocd-cm" not found
I got the same error here :
20 terraform-voggt-bits-internal/modules/argocd ✗ argocd version
argocd: v2.4.13+19ec34e.dirty
BuildDate: 2022-10-03T22:54:38Z
GitCommit: 19ec34e134cac5e693ddd5f56844a946e6e1d44b
GitTreeState: dirty
GoVersion: go1.19.1
Compiler: gc
Platform: linux/amd64
argocd-server: v2.4.13+19ec34e.dirty
BuildDate: 2022-10-03T22:54:38Z
GitCommit: 19ec34e134cac5e693ddd5f56844a946e6e1d44b
GitTreeState: dirty
GoVersion: go1.19.1
Compiler: gc
Platform: linux/amd64
Kustomize Version: could not get kustomize version: exec: "kustomize": executable file not found in $PATH
Helm Version: v3.10.0+gce66412
Kubectl Version: v0.23.1
Jsonnet Version: v0.18.0
➜ argocd admin cluster generate-spec my-context
FATA[0000] configmap "argocd-cm" not found
still persists
I stumbled across this issue today. I think I know the reason too.
https://github.com/argoproj/argo-cd/blob/9b4f468f728d44ef4e90d5a1f9cc22c45dd0adc1/cmd/argocd/commands/admin/cluster.go#L555
generate-spec
is using a fake client to generate the spec and I think that as part of the generation process, the argocd-cd
configmap
is attempted to be checked. Since a fake client is getting used, I believe that is the reason its returning "not found".
Not sure how to fix this though.
still the issue is exist ! :(