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

Bug 1820595: Support for specific http proxy for the service #87

Conversation

martinkunc
Copy link
Contributor

@martinkunc martinkunc commented Mar 19, 2020

This change allows to override proxy passed with Env using support secret.
It uses golang build-in proxy settings, including noproxy logic.

@martinkunc martinkunc changed the title Support for specific http proxy for the service WIP: Support for specific http proxy for the service Mar 19, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2020
@martinkunc
Copy link
Contributor Author

/retest

@martinkunc martinkunc changed the title WIP: Support for specific http proxy for the service Support for specific http proxy for the service Mar 20, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 20, 2020
@martinkunc
Copy link
Contributor Author

/retest

5 similar comments
@martinkunc
Copy link
Contributor Author

/retest

@martinkunc
Copy link
Contributor Author

/retest

@martinkunc
Copy link
Contributor Author

/retest

@martinkunc
Copy link
Contributor Author

/retest

@martinkunc
Copy link
Contributor Author

/retest

},
{
Name: "Env set, specific proxy set noproxy, request without noproxy",
EnvValues: map[string]interface{}{"HTTPS_PROXY": "envsecproxy.to", "NO_PROXY": "envnoproxy.to"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about HTTP/S_PROXY values, but shouldn't the NO_PROXY support multiple values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, it should, there is just no test for that..

@martinkunc
Copy link
Contributor Author

/assign smarterclayton

}

// FromConfig is setting HttpProxy from HttpConfig in support secret, if it is used
func FromConfig(c config.HTTPConfig) func(req *http.Request) (*url.URL, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

ProxyFromConfig as name

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, these two methods are confusingly named in general. This should probably be NewProxyFromConfig() in the line above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed them when I moved the logic to authorizer and removed options to simplify a bit.

@@ -40,6 +43,7 @@ type Client struct {

type Authorizer interface {
Authorize(req *http.Request) error
HTTPConfig() config.HTTPConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the authorizer not handling the proxy setup? It already has all the config info.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it there. If you ment something like a Roundtripper with dynamic injectable Proxy, I can prepare it as well, but at first it seemed a bit too much code.

@alexandrevicenzi
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 1, 2020
@alexandrevicenzi
Copy link
Contributor

@martinkunc we need this in 4.3 as well.

…rtinkunc/insights-operator into allow-specific-http-proxy-from-secret
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 1, 2020
@martinkunc
Copy link
Contributor Author

I tried to squeeze the changes, which invalidated the lgtms, sorry.

@martinkunc
Copy link
Contributor Author

/retest

Copy link
Contributor

@alexandrevicenzi alexandrevicenzi left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 1, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexandrevicenzi, martinkunc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit a4560d8 into openshift:master Apr 1, 2020
@martinkunc martinkunc changed the title Support for specific http proxy for the service Bug 1805940: Support for specific http proxy for the service Apr 3, 2020
@openshift-ci-robot
Copy link
Contributor

@martinkunc: Bugzilla bug 1805940 is in an unrecognized state (VERIFIED) and will not be moved to the MODIFIED state.

In response to this:

Bug 1805940: Support for specific http proxy for the service

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 kubernetes/test-infra repository.

@martinkunc martinkunc changed the title Bug 1805940: Support for specific http proxy for the service Bug 1820595: Support for specific http proxy for the service Apr 3, 2020
@openshift-ci-robot
Copy link
Contributor

@martinkunc: All pull requests linked via external trackers have merged: . Bugzilla bug 1820595 has been moved to the MODIFIED state.

In response to this:

Bug 1820595: Support for specific http proxy for the service

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 kubernetes/test-infra repository.

@openshift-cherrypick-robot

@martinkunc: #87 failed to apply on top of branch "release-4.4":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	go.mod
M	pkg/config/configobserver/configobserver.go
M	pkg/insights/insightsclient/insightsclient.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/insights/insightsclient/insightsclient.go
CONFLICT (content): Merge conflict in pkg/insights/insightsclient/insightsclient.go
Auto-merging pkg/config/configobserver/configobserver.go
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
Patch failed at 0001 Support for specific http proxy for the service

In response to this:

/cherry-pick release-4.4

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 kubernetes/test-infra repository.

@openshift-cherrypick-robot

@martinkunc: #87 failed to apply on top of branch "release-4.3":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	go.mod
M	pkg/config/configobserver/configobserver.go
M	pkg/insights/insightsclient/insightsclient.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/insights/insightsclient/insightsclient.go
CONFLICT (content): Merge conflict in pkg/insights/insightsclient/insightsclient.go
Auto-merging pkg/config/configobserver/configobserver.go
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
Patch failed at 0001 Support for specific http proxy for the service

In response to this:

/cherry-pick release-4.3

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 kubernetes/test-infra repository.

@martinkunc
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@martinkunc: Bugzilla bug 1820595 is in an unrecognized state (MODIFIED) and will not be moved to the MODIFIED state.

In response to this:

/bugzilla refresh

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 kubernetes/test-infra repository.

@martinkunc
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@martinkunc: All pull requests linked via external trackers have merged: . Bugzilla bug 1820595 has been moved to the MODIFIED state.

In response to this:

/bugzilla refresh

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 kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants