Skip to content

Commit

Permalink
fix: log error when failing to get git client (argoproj#12876)
Browse files Browse the repository at this point in the history
* fix: log error when failing to get git client

Signed-off-by: Michael Crenshaw <[email protected]>

* Update reposerver/repository/repository.go

Co-authored-by: jannfis <[email protected]>
Signed-off-by: Michael Crenshaw <[email protected]>

* Update reposerver/repository/repository.go

Co-authored-by: jannfis <[email protected]>
Signed-off-by: Michael Crenshaw <[email protected]>

---------

Signed-off-by: Michael Crenshaw <[email protected]>
Co-authored-by: jannfis <[email protected]>
  • Loading branch information
2 people authored and xiaowu.zhu committed Aug 9, 2023
1 parent 9d7f046 commit e13ec80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reposerver/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ func resolveReferencedSources(hasMultipleSources bool, source *v1alpha1.Applicat
if !ok {
_, referencedCommitSHA, err := newClientResolveRevision(&refSourceMapping.Repo, refSourceMapping.TargetRevision)
if err != nil {
log.Errorf("Failed to get git client for repo %s: %v", refSourceMapping.Repo.Repo, err)
return nil, fmt.Errorf("failed to get git client for repo %s", refSourceMapping.Repo.Repo)
}

Expand Down Expand Up @@ -706,6 +707,7 @@ func (s *Service) runManifestGenAsync(ctx context.Context, repoRoot, commitSHA,
} else {
gitClient, referencedCommitSHA, err := s.newClientResolveRevision(&refSourceMapping.Repo, refSourceMapping.TargetRevision)
if err != nil {
log.Errorf("Failed to get git client for repo %s: %v", refSourceMapping.Repo.Repo, err)
ch.errCh <- fmt.Errorf("failed to get git client for repo %s", refSourceMapping.Repo.Repo)
return
}
Expand Down

0 comments on commit e13ec80

Please sign in to comment.