diff options
| author | Ben Fu <9794300+benfuu@users.noreply.github.com> | 2024-06-23 22:42:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-23 23:42:03 -0400 |
| commit | 9ad9e4faaf7f6c89f1565ca5f240a26e139860b6 (patch) | |
| tree | a08888cbca4686fb13d83d730eada563e0775280 /pkg | |
| parent | 38c82f3c100eb0022c333a1c63c234158b20b829 (diff) | |
fix: pass through git store to git creds (#756)
Signed-off-by: Ben Fu <ben@benfu.me>
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/argocd/gitcreds.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/argocd/gitcreds.go b/pkg/argocd/gitcreds.go index 90dc056..20be98e 100644 --- a/pkg/argocd/gitcreds.go +++ b/pkg/argocd/gitcreds.go @@ -130,7 +130,7 @@ func getCredsFromSecret(wbc *WriteBackConfig, credentialsSecret string, kubeClie if sshPrivateKey, ok = credentials["sshPrivateKey"]; !ok { return nil, fmt.Errorf("invalid secret %s: does not contain field sshPrivateKey", credentialsSecret) } - return git.NewSSHCreds(string(sshPrivateKey), "", true, git.NoopCredsStore{}, ""), nil + return git.NewSSHCreds(string(sshPrivateKey), "", true, wbc.GitCreds, ""), nil } else if git.IsHTTPSURL(wbc.GitRepo) { var username, password, githubAppID, githubAppInstallationID, githubAppPrivateKey []byte if githubAppID, ok = credentials["githubAppID"]; ok { @@ -149,12 +149,12 @@ func getCredsFromSecret(wbc *WriteBackConfig, credentialsSecret string, kubeClie if err != nil { return nil, fmt.Errorf("invalid value in field githubAppInstallationID: %w", err) } - return git.NewGitHubAppCreds(intGithubAppID, intGithubAppInstallationID, string(githubAppPrivateKey), "", "", "", "", true, "", git.NoopCredsStore{}), nil + return git.NewGitHubAppCreds(intGithubAppID, intGithubAppInstallationID, string(githubAppPrivateKey), "", "", "", "", true, "", wbc.GitCreds), nil } else if username, ok = credentials["username"]; ok { if password, ok = credentials["password"]; !ok { return nil, fmt.Errorf("invalid secret %s: does not contain field password", credentialsSecret) } - return git.NewHTTPSCreds(string(username), string(password), "", "", true, "", git.NoopCredsStore{}, false), nil + return git.NewHTTPSCreds(string(username), string(password), "", "", true, "", wbc.GitCreds, false), nil } return nil, fmt.Errorf("invalid repository credentials in secret %s: does not contain githubAppID or username", credentialsSecret) } |
