Skip to content

Commit

Permalink
update resolveRevision to use the correct source for multi-source app (
Browse files Browse the repository at this point in the history
…#18194) (#18202)

Co-authored-by: Ishita Sequeira <[email protected]>
  • Loading branch information
gcp-cherry-pick-bot[bot] and ishitasequeira authored May 20, 2024
1 parent eee5c06 commit 37dd289
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,12 @@ func (s *Server) resolveRevision(ctx context.Context, app *appv1.Application, sy

ambiguousRevision := getAmbiguousRevision(app, syncReq, sourceIndex)

repo, err := s.db.GetRepository(ctx, app.Spec.GetSource().RepoURL)
repoUrl := app.Spec.GetSource().RepoURL
if app.Spec.HasMultipleSources() {
repoUrl = app.Spec.Sources[sourceIndex].RepoURL
}

repo, err := s.db.GetRepository(ctx, repoUrl)
if err != nil {
return "", "", fmt.Errorf("error getting repository by URL: %w", err)
}
Expand Down

0 comments on commit 37dd289

Please sign in to comment.