-
Notifications
You must be signed in to change notification settings - Fork 90
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 proxy support for oci/auth login #808
Conversation
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
12b347d
to
8b5c43a
Compare
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.
LGTM!
For testing the proxy usage, we can add a proxy based test in the OCI integration tests later. I believe we need to figure out some way to test it.
if c.proxyURL != nil { | ||
transport := http.DefaultTransport.(*http.Transport).Clone() | ||
transport.Proxy = http.ProxyURL(c.proxyURL) | ||
confOpts = append(confOpts, config.WithHTTPClient(&http.Client{Transport: transport})) |
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.
This made me wonder if the explicitly set proxy should be respected when the aws.Config
is configured externally. It looks like we can modify the given aws.Config
to add proxy to it. But the same can't be done in case of Azure. It'll work for GCP easily as there's no external client in that case.
I believe the ability to provide external config was added just to make testing easier. I don't think anyone uses it for anything else.
I think for consistency across all the clients, it's better to not try to add proxy if an external client config is provided. So, it's good as it is.
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.
LGTM
Thanks @matheuscscp 🏅
PS. I will do an oci release so we can move forward with image reflector.
Part of fluxcd/image-reflector-controller#612