-
Notifications
You must be signed in to change notification settings - Fork 272
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
Unable to use in-cluster kube client for "test" command #288
Comments
As opposed to the But I agree that there might be a valid use case for running So probably, we should mimic the
|
…abs#288) * Use in-cluster kube client unless k8s is disabled * Add `--argocd-namespace` option to test-command * Assign `ctx` only if needed Signed-off-by: Jan Pieper <[email protected]>
…abs#288) * Use in-cluster kube client unless k8s is disabled * Assign `ctx` only if needed Signed-off-by: Jan Pieper <[email protected]>
* Use in-cluster kube client unless k8s is disabled * Assign `ctx` only if needed Signed-off-by: Jan Pieper <[email protected]> Co-authored-by: Jan Pieper <[email protected]>
Closed by #293 |
…abs#288) (argoproj-labs#293) * Use in-cluster kube client unless k8s is disabled * Assign `ctx` only if needed Signed-off-by: Jan Pieper <[email protected]> Co-authored-by: Jan Pieper <[email protected]>
…abs#288) (argoproj-labs#293) * Use in-cluster kube client unless k8s is disabled * Assign `ctx` only if needed Signed-off-by: Jan Pieper <[email protected]> Co-authored-by: Jan Pieper <[email protected]>
Describe the bug
Running
argocd-image-updater test [...]
with credentials in a kubernetesSecret
fails when running inside a kubernetes cluster.To Reproduce
Secret
forcredentials
.argocd-image-updater test [...]
Expected behavior
Use in-cluster kube client.
Additional context
I think I already tracked down the error. When running
argocd-image-updater test [...]
inside a kubernetes cluster, I get the following warning, becausekubeClient
isnil
:argocd-image-updater/pkg/registry/registry.go
Lines 193 to 198 in 71b1dac
The
kubeClient
isnil
, because I do not specify--kubeconfig
, so it skips creating a kube client:argocd-image-updater/cmd/main.go
Lines 344 to 349 in 71b1dac
Checking for
kubeConfig != ""
is wrong because""
(empty string) tellsgetKubeConfig
to return an in-cluster kube client (see line 661):argocd-image-updater/cmd/main.go
Lines 646 to 662 in 71b1dac
I had a look into what
argocd-image-updater run [...]
does in this case and found out it does not check forkubeConfig != ""
. Instead if checks for!disableKubernetes
:argocd-image-updater/cmd/main.go
Lines 526 to 535 in 71b1dac
I think using
!disableKubernetes
would be the correct check forargocd-image-updater test [...]
too.Version
0.10.1 (via Helm chart)
Logs
The text was updated successfully, but these errors were encountered: