-
Notifications
You must be signed in to change notification settings - Fork 63
Add DockerProxy field for dynamic proxy configuration #583
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
Add DockerProxy field for dynamic proxy configuration #583
Conversation
|
✅ A new PR has been created in buildah to vendor these changes: containers/buildah#6627 |
Add a new DockerProxy field to SystemContext that accepts a function for determining proxy URLs dynamically per request. This provides more flexibility than the static DockerProxyURL field, allowing for advanced proxy configurations such as those from httpproxy.Config.ProxyFunc(). Signed-off-by: Pablo Rodriguez Nava <[email protected]>
f22b8f2 to
2cf5727
Compare
mtrmac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. The implementation looks reasonable, but is it really necessary? The default behavior is net/http.ProxyFromEnvironment, which internally calls the same golang.org/x/net/http/httpproxy.
Certainly manual configuration of httpproxy.Config is not equivalent to reading from the environment, but … I think it would be pretty surprising for a proxy configuration of that kind to only apply to some references. Either registry.example needs a proxy or it doesn’t, I don’t see how using it for one operation and not using it for another makes much sense.
Thanks for the review @mtrmac . As we discussed offline, here is the context on why relying on http.ProxyFromEnvironment or creating a new context per request isn't viable for our use case:
This change allows us to bridge that gap safely. |
mtrmac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Add a new DockerProxy field to SystemContext that accepts a function for determining proxy URLs dynamically per request. This provides more flexibility than the static DockerProxyURL field, allowing for advanced proxy configurations such as those from httpproxy.Config.ProxyFunc().