-
Notifications
You must be signed in to change notification settings - Fork 40.3k
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
Use specified ServerName in aggregator TLS validation #49353
Conversation
cc @kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-api-machinery-bugs |
/retest |
@@ -158,27 +158,28 @@ func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) { | |||
return nil, err | |||
} | |||
|
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 bit fixes two existing bugs:
- mutation of the roundtripper
- mutation of the original tlsConfig (which the round tripper should not assume it is free to modify)
path := "/apis/" + tc.APIService.Spec.Group + "/" + tc.APIService.Spec.Version + "/foo" | ||
called := false | ||
|
||
func() { // Cleanup after each test case. |
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.
Can you use subtests?
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.
tried it, it triggered the race detector on references to the iterators, didn't feel like messing with it
@@ -218,3 +226,189 @@ func TestProxyHandler(t *testing.T) { | |||
}() | |||
} | |||
} | |||
|
|||
func TestProxyUpgrade(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.
remove
Service: &apiregistration.ServiceReference{}, | ||
Group: "foo", | ||
Version: "v1", | ||
InsecureSkipTLSVerify: true, |
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.
I take it this is now part of TestProxyUpgrade
?
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.
actually, I can keep this one intact and add a caBundle test... I wanted a TLS test for normal connections
test nits addressed |
/lgtm |
/test pull-kubernetes-federation-e2e-gce |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, liggitt, ncdc Associated issue: 49354 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue |
|
@janetkuo looking... |
Automatic merge from submit-queue fix race in proxy unit test fixes #49413, follow up to #49353 to fix a race in the unit test: ``` go test -v k8s.io/kubernetes/vendor/k8s.io/kube-aggregator/pkg/apiserver -run TestProxyUpgrade$ handler_proxy_test.go:328: invalid hostname + insecure: expected called=true, got false testing.go:610: race detected during execution of test ``` https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/48746/pull-kubernetes-unit/42230/
Cherrypick in #49560 |
Was picked in #49403 |
Pick in #49403 includes the unit test race fix |
Commit found in the "release-1.7" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
Fixes #49354
The aggregator sets a ServerName in the proxier tlsConfig, but the code path handling websocket upgrade requests did not honor it, and instead tried to verify TLS using the dialed host