55 "fmt"
66 "runtime"
77
8- "github.com/argoproj-labs/argocd-image-updater/pkg/kube"
8+ kube "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/kube"
9+
910 "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/image"
1011 "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/log"
1112 "github.com/argoproj-labs/argocd-image-updater/registry-scanner/pkg/options"
@@ -64,14 +65,14 @@ argocd-image-updater test nginx --allow-tags '^1.19.\d+(\-.*)*$' --update-strate
6465 log .Fatalf ("could not set log level to %s: %v" , logLevel , err )
6566 }
6667
67- var kubeClient * kube.ImageUpdaterKubernetesClient
68- var err error
68+ var kubeClient * kube.KubernetesClient
6969 if ! disableKubernetes {
7070 ctx := context .Background ()
71- kubeClient , err = getKubeConfig (ctx , "" , kubeConfig )
71+ kc , err : = getKubeConfig (ctx , "" , kubeConfig )
7272 if err != nil {
7373 log .Fatalf ("could not create K8s client: %v" , err )
7474 }
75+ kubeClient = kc .KubeClient
7576 }
7677
7778 img := image .NewFromIdentifier (args [0 ])
@@ -118,7 +119,7 @@ argocd-image-updater test nginx --allow-tags '^1.19.\d+(\-.*)*$' --update-strate
118119 logCtx .Fatalf ("could not get registry endpoint: %v" , err )
119120 }
120121
121- if err := ep .SetEndpointCredentials (kubeClient . KubeClient ); err != nil {
122+ if err := ep .SetEndpointCredentials (kubeClient ); err != nil {
122123 logCtx .Fatalf ("could not set registry credentials: %v" , err )
123124 }
124125
@@ -138,7 +139,7 @@ argocd-image-updater test nginx --allow-tags '^1.19.\d+(\-.*)*$' --update-strate
138139 if err != nil {
139140 logCtx .Fatalf ("could not parse credential definition '%s': %v" , credentials , err )
140141 }
141- creds , err = credSrc .FetchCredentials (ep .RegistryAPI , kubeClient . KubeClient )
142+ creds , err = credSrc .FetchCredentials (ep .RegistryAPI , kubeClient )
142143 if err != nil {
143144 logCtx .Fatalf ("could not fetch credentials: %v" , err )
144145 }
0 commit comments