Skip to content

Commit 195c758

Browse files
authored
fix: Use correct registry URL for parsing pull secrets (#285)
1 parent a03f319 commit 195c758

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ argocd-image-updater test nginx --allow-tags '^1.19.\d+(\-.*)*$' --update-strate
121121
if err != nil {
122122
log.Fatalf("could not parse credential definition '%s': %v", credentials, err)
123123
}
124-
creds, err = credSrc.FetchCredentials(img.RegistryURL, kubeClient)
124+
creds, err = credSrc.FetchCredentials(ep.RegistryAPI, kubeClient)
125125
if err != nil {
126126
log.Fatalf("could not fetch credentials: %v", err)
127127
}

pkg/image/credentials.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func ParseCredentialSource(credentialSource string, requirePrefix bool) (*Creden
9494
// the credential source.
9595
func (src *CredentialSource) FetchCredentials(registryURL string, kubeclient *kube.KubernetesClient) (*Credential, error) {
9696
var creds Credential
97+
log.Tracef("Fetching credentials for registry %s", registryURL)
9798
switch src.Type {
9899
case CredentialSourceEnv:
99100
credEnv := os.Getenv(src.EnvName)
@@ -233,7 +234,7 @@ func parseDockerConfigJson(registryURL string, jsonSource string) (string, strin
233234

234235
for registry, authConf := range auths {
235236
if !strings.HasPrefix(registry, registryURL) && !strings.HasPrefix(registry, regPrefix) {
236-
log.Tracef("found registry %s in image pull secret, but we want %s - skipping", registry, registryURL)
237+
log.Tracef("found registry %s in image pull secret, but we want %s (%s) - skipping", registry, registryURL, regPrefix)
237238
continue
238239
}
239240
authEntry, ok := authConf.(map[string]interface{})

0 commit comments

Comments
 (0)