argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.06k stars 5.51k forks source link

`argocd login --core` is using local cli instead the API server #19640

Open liranZiv27 opened 3 months ago

liranZiv27 commented 3 months ago

Checklist:

Describe the bug

We have a management argocd instance, which deploys apps to "worker" clusters. When using the argocd cli to log into the argocd instance with the --core flag, all commands that need access to the worker clusters fail with this error, which doesn't appear in any logs, therefore the assumption it's executed using kubectl locally -

time="2024-08-21T10:03:44Z" level=fatal msg="rpc error: code = Unknown desc = error validating and updating app: error validating and normalizing app: error validating the repo: error getting k8s server version: Get \"https://*****************.eks.amazonaws.com/version?timeout=32s\": getting credentials: exec: executable argocd-k8s-auth not found%0A%0AIt looks like you are trying to use a client-go credential plugin that is not installed.%0A%0ATo learn more about this feature, consult the documentation available at:%0A      https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins"

Worker clusters are authenticated and have workloads deployed.

To Reproduce

Expected behavior

Running argocd app set deploys the specified version

Version

argocd: v2.12.1+26b2039
  BuildDate: 2024-08-16T18:33:39Z
  GitCommit: 26b2039a55b9bdf807a70d344af8ade5171d3d39
  GitTreeState: clean
  GoVersion: go1.22.6
  Compiler: gc
  Platform: darwin/arm64

Logs

Paste any relevant application logs here.
felfa01 commented 1 month ago

Ran into this issue as well with argocd app set. Works fine when modifying Applications with destination local to the current context but throws error when modifying Applications with external destinations.

A workaround for me is using kubectl patch Application , but I'd rather use the ArgoCD cli.