Skip to content

Commit

Permalink
Use libgit2 auto proxy configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien GARNIER <aurelien.garnier@atos.net>
  • Loading branch information
Aurélien GARNIER committed Dec 23, 2021
1 parent f82654d commit 33ea33f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/imageupdateautomation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,9 @@ func fetch(ctx context.Context, path string, branch string, access repoAccess) e
[]string{refspec},
&libgit2.FetchOptions{
RemoteCallbacks: access.remoteCallbacks(ctx),
ProxyOptions: libgit2.ProxyOptions{
Type: libgit2.ProxyTypeAuto,
},
}, "",
)
if err != nil && libgit2.IsErrorCode(err, libgit2.ErrorCodeNotFound) {
Expand Down Expand Up @@ -684,6 +687,9 @@ func push(ctx context.Context, path, branch string, access repoAccess) error {
}
err = origin.Push([]string{fmt.Sprintf("refs/heads/%s:refs/heads/%s", branch, branch)}, &libgit2.PushOptions{
RemoteCallbacks: callbacks,
ProxyOptions: libgit2.ProxyOptions{
Type: libgit2.ProxyTypeAuto,
},
})
if err != nil {
return libgit2PushError(err)
Expand Down

0 comments on commit 33ea33f

Please sign in to comment.