Skip to content

Commit

Permalink
fix: added logging if repo credentials collide (argoproj#16833)
Browse files Browse the repository at this point in the history
Signed-off-by: doxsch <[email protected]>
Signed-off-by: Adrian Aneci <[email protected]>
  • Loading branch information
doxsch authored and adriananeci committed Feb 25, 2024
1 parent a3d278f commit a105750
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util/db/repository_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ func (s *secretsRepositoryBackend) getRepositoryCredentialIndex(repoCredentials
for i, cred := range repoCredentials {
credUrl := git.NormalizeGitURL(string(cred.Data["url"]))
if strings.HasPrefix(repoURL, credUrl) {
if len(credUrl) == max {
log.Warnf("Found multiple credentials for repoURL: %s", repoURL)
}
if len(credUrl) > max {
max = len(credUrl)
idx = i
Expand Down

0 comments on commit a105750

Please sign in to comment.