Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure libgit2 fetch and push ProxyOptions #285

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

au2001
Copy link
Contributor

@au2001 au2001 commented Dec 23, 2021

Similarly to fluxcd/source-controller#524, this PR allows to specify an HTTP(S) proxy for Git operations through environment variables.

Fixes #279.

This is a draft for now because the current version of git2go's bindings do not allow to specify ProxyOptions for push operations, only for clone and fetch.
It first requires libgit2/git2go#872 to be merged and backported to release-1.1 (v31), which is the version of libgit2 used by image-automation-controller (and source-controller).

@au2001 au2001 force-pushed the http-auto-proxy-dev branch from 6c8d6a1 to 33ea33f Compare December 23, 2021 15:45
@au2001 au2001 force-pushed the http-auto-proxy-dev branch 2 times, most recently from 08878c7 to 01143b2 Compare January 18, 2022 11:20
@au2001
Copy link
Contributor Author

au2001 commented Jan 18, 2022

libgit2/git2go#872 has been merged and backported to release-1.1 in libgit2/git2go@a800947 as v31.7.6 earlier today.
So this PR is now ready for review.

I had to bump the version of git2go from v31.6.1 to v31.7.6 which contains the new push proxy options. I hope that's not an issue, given that there are no breaking changes documented between those two versions.

@hiddeco Do you want me to implement similar test cases than the ones for fluxcd/source-controller#524, or are the tests in that PR sufficient?

@au2001 au2001 marked this pull request as ready for review January 18, 2022 13:54
@darkowlzz
Copy link
Contributor

darkowlzz commented Jan 20, 2022

@au2001 Thanks a lot for adding the support in upstream git2go. Good to see that there's already a release available for it.

Do you want me to implement similar test cases than the ones for fluxcd/source-controller#524, or are the tests in that PR sufficient?

I don't think we need that. We have tests now in SC that helped us understand what works and what doesn't. We don't have any proxy test that performs any writing operations. It may be useful to have such tests in SC, along with other proxy tests. I wouldn't hold this change for that.

I had to bump the version of git2go from v31.6.1 to v31.7.6 which contains the new push proxy options. I hope that's not an issue, given that there are no breaking changes documented between those two versions.

That shouldn't be an issue.

We should also update the git2go version in SC.

@darkowlzz
Copy link
Contributor

@au2001 could you rebase this against the main branch?

Signed-off-by: Aurélien GARNIER <aurelien.garnier@atos.net>
@au2001 au2001 force-pushed the http-auto-proxy-dev branch from 01143b2 to 9b82e81 Compare January 20, 2022 16:14
@au2001
Copy link
Contributor Author

au2001 commented Jan 20, 2022

@darkowlzz I have now rebased it with the latest commits from the main branch.

Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libgit2 does not support HTTP proxy for Git clone/fetch/push
3 participants