Skip to content

Commit

Permalink
fix: Allow use of in-cluster kube-client for test-command (argoproj-l…
Browse files Browse the repository at this point in the history
…abs#288) (argoproj-labs#293)

* Use in-cluster kube client unless k8s is disabled

* Assign `ctx` only if needed

Signed-off-by: Jan Pieper <kontakt@jan-pieper.info>

Co-authored-by: Jan Pieper <kontakt@jan-pieper.info>
  • Loading branch information
2 people authored and sribiere-jellysmack committed Aug 13, 2024
1 parent fc66e7e commit 39f4c18
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ argocd-image-updater test nginx --allow-tags '^1.19.\d+(\-.*)*$' --update-strate
log.Fatalf("could not set log level to %s: %v", logLevel, err)
}

ctx := context.Background()

var kubeClient *kube.KubernetesClient
var err error
if kubeConfig != "" {
if !disableKubernetes {
ctx := context.Background()
kubeClient, err = getKubeConfig(ctx, "", kubeConfig)
if err != nil {
log.Fatalf("could not create K8s client: %v", err)
Expand Down

0 comments on commit 39f4c18

Please sign in to comment.