Add Proxy to InstallConfig#1827
Conversation
There was a problem hiding this comment.
i would have assumed, atleast one of HTTPProxy and HTTPSProxy; user could have empty no-proxy list.
There was a problem hiding this comment.
I am updating the conditional to:
p.HTTPProxy == "" && p.HTTPSProxy == "" && p.NoProxy != "*"
I believe this is a valid edge case, which effectively disables the proxy.
There was a problem hiding this comment.
Setting HTTPProxy and HTTPSProxy to empty are sufficient to disable the proxy. Any valid value in NoProxy would be effectively ignored since there is no proxy to bypass. However, the way to disable the proxy is to exclude the Proxy field form the install config. If the Proxy field is present, then at least on of HTTPProxy and HTTPSProxy should be present. The user could still choose to disable the proxy by setting NoProxy to *, but even if this case at least one of HTTPProxy and HTTPSProxy should be set.
I don't think that the installer should support setting * for NoProxy at all. The necessity for supporting that in the API is that it is the way to disable the proxy, where a Proxy resource should exist. In the installer, however, the preferred way to disable the proxy should be to omit Proxy from the install config.
There was a problem hiding this comment.
The user could still choose to disable the proxy by setting NoProxy to *, but even if this case at least one of HTTPProxy and HTTPSProxy should be set.
This makes sense.
I don't think that the installer should support setting * for NoProxy at all.
I am inclined to agree, but my reservation is that it was supported in 3.11 and I believe the situation was similar (proxy could just be omitted from the Ansible inventory). So it would be good to know if there was an intention behind the 3.11 design.
There was a problem hiding this comment.
maybe add cases like:
- noProxy invalid domain
- noProxy invalid cidr
- noProxy one of many invalid
- noProxy two of many invalid
d65ac3a to
b884346
Compare
e020817 to
062e800
Compare
|
I have pushed new commits which I believe address all outstanding comments/concerns. PTAL, |
There was a problem hiding this comment.
maybe extend the URI to check the scheme of the URI...?
There was a problem hiding this comment.
I created URIWithProtocol to do this. Let me know if that is not what you had in mind or suggestions.
58ce222 to
af38961
Compare
There was a problem hiding this comment.
you can parse to URL and check for scheme.... ? rather than string prefix.
af38961 to
bd7b189
Compare
|
/skip |
There was a problem hiding this comment.
nit: this else is not required..
from https://golang.org/doc/effective_go.html#if
In the Go libraries, you'll find that when an if statement doesn't flow into the next statement—that is, the body ends in break, continue, goto, or return—the unnecessary else is omitted. |
/approve one small nit #1827 (comment) |
Add Proxy struct from OpenShift API to Install Config so users can specify cluster-wide proxy configuration. Add basic validation to ensure that the proxy configuration being created is sane. Jira: CORS-1075
bd7b189 to
08b7bc4
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, patrickdillon 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 |
|
@patrickdillon: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
As a step toward cluster proxies, add support for proxies to the InstallConfig. This PR creates the
Proxytype struct and adds it to the InstallConfig. It also adds validation and unit tests for the validation.Jira: CORS-1075
Related PRS: openshift/api#335, openshift/cluster-config-operator#66
This is a work in progress but I am looking for feedback:
Just realized I also need to fill in the commit messages.