-
Notifications
You must be signed in to change notification settings - Fork 164
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
Respect proxy settings and set http timeout in login and ssh commands #406
Conversation
KubeCredentials map[string]*ExecCredential `json:"kubeCredentials"` | ||
KubeConfigs map[string]*api.Config `json:"kubeConfigs"` | ||
ProxyURL string `json:"proxyUrl"` | ||
HTTPTimeoutSeconds int `json:"httpTimeoutSeconds"` |
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.
We probably don't need a finer precision for this. Thus *Seconds
.
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
406de4c
@@ -200,3 +204,91 @@ func TestGetMemberNameFromPrincipal(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestNewHTTPClient(t *testing.T) { |
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.
FYI Can't use t.Parallel()
because of t.Setenv()
.
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. Tests seem reasonable.
Should link the issue
Apparently we never had one, so I opened a new one. |
Start local proxy
Set proxy and run rancher cli
|
Ref: rancher/rancher#48321
Dedicated http clients in login and ssh commands that downloads certs and an ssh key respectively currently don't respect proxy settings and don't set http timeout.
This PR fixes that and makes use of Norman's API Client Timeout and ProxyURL options and makes it possible to specify those in the server config.