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]>
  • Loading branch information
doxsch authored and clement-heetch committed Feb 12, 2024
1 parent bdfbf14 commit 6dbe978
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 6dbe978

Please sign in to comment.