fix: When constructing a client with a proxy, don't override the global http transport#827
Conversation
| return nil, err | ||
| return nil, fmt.Errorf("failed to create http client: %w", err) | ||
| } | ||
| http.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(proxy)} |
There was a problem hiding this comment.
This is the global state modification we are removing
|
@joshbranham: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@joshbranham: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #827 +/- ##
==========================================
- Coverage 53.15% 53.07% -0.09%
==========================================
Files 86 86
Lines 6430 6440 +10
==========================================
Hits 3418 3418
- Misses 2555 2565 +10
Partials 457 457
🚀 New features to boost your workflow:
|
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joshbranham, samanthajayasinghe The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
What this PR does / Why we need it?
The current implementation of injecting an http proxy relied on overriding the global default HTTP transport. Instead of modifying global state, we can accomplish this by using the
WithHTTPClient()client options func from the backplane-api SDK.Which Jira/Github issue(s) does this PR fix?
Special notes for your reviewer
Unit Test Coverage
Guidelines
Test coverage checks
Pre-checks (if applicable)
/label tide/merge-method-squash