-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
argocd version --client
does not work offline in --core mode
#7986
Comments
argocd version --client
still requires k8s access in --core modeargocd version --client
does not work offline in --core mode
This affects much more parts of the CLI. E.g. when your
Surprisingly, explicitly calling a top level command with
|
Hi, I'm interested in solving this problem since it is tagged good first issue. Can I get some more help or guidance on how to do contribute? |
Thanks @khalilswdp. You can follow this link |
any update? |
Hi @debu99, I found out that we're using cobra go client for the cli, and that this is the exact line in cobra that deals with the entered command argo-cd/cmd/argocd/commands/version.go Line 80 in b37eee1
|
I think we should find a way to deal with an error if one occurs especially in this line: argo-cd/cmd/argocd/commands/version.go Line 89 in b37eee1
please, if you have advice or suggestions, let me know |
haven't checked the root cause yet but my workaround is change the default namespace to arogcd then no more errors |
I think we can propose instead of checking the version and getting an error immediately afterwards if there's an error: errors.CheckError(err)
return v We check if there's no error, we return the version as usual, otherwise, we get it from common (which doesn't return an error): if err == nil {
return v
}
vers := common.GetVersion()
return &version.VersionMessage{Version: vers.Version} I am sorry, i'm not really good at Go or Cobra or argocd, and I haven't fully understood how it works. I also don't know how to test the changes I've made even after reading the toolchain guide.
and:
And
when trying to run |
I had more luck with the local toolchain on Fedora 35. Podman cannot quite manage the docker permissions the same as docker, so I had to switch. To make just the client, do |
I was debugging where the error originates from and it appears that even for client version calls the PreRun hook tries to startup the local API server. I have added a check for |
When using ArgoCD in --core mode, I had just wanted to see argocd client version, and I did not have a connection to k8s or argocd server. But
argocd version --client
still tries to connect:When k8s access is unavailable:
When k8s is available, but argocd is not installed:
The expectation is that
argocd version --client
should always work in an offline mode.To reproduce:
Affected Version:
The text was updated successfully, but these errors were encountered: