-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Plumbing the proxy dialer to the webhook admission plugin; Fix the tls config #50476
Conversation
Still a WIP, because I don't know what's the proper way to test it. |
/release-note-none |
4c7cd44
to
5ac3afe
Compare
This seems somewhat GKE specific. Can we add apimachinery e2e test for at least one cloud provider which uses the dialer (GKE) and one which does not (GCE)? |
5ac3afe
to
6c8b934
Compare
The fix is not working yet.
API server log:
|
Reproduced in the unit test. |
Got it working in my local gke setup. I'll try to get together an gke e2e test, but no promise at the moment. |
6c8b934
to
e8aa5c1
Compare
@caesarxuchao: Your pull request title starts with "[WIP]", so the do-not-merge/work-in-progress label will be added. This label will ensure that your pull request will not be merged. Remove the prefix from your pull request title to trigger the removal of the label and allow for your pull request to be merged. 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. |
e8aa5c1
to
8b8917d
Compare
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.
Need to look at the old certs customers may have had.
CAData: h.ClientConfig.CABundle, | ||
CertData: a.clientCert, | ||
KeyData: a.clientKey, | ||
ServerName: h.ClientConfig.Service.Name + "." + h.ClientConfig.Service.Namespace + "." + "svc", |
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.
- Is this backward compatible for old clients?
- Not a big deal but do we really need to do "." + "svc" vs ".svc"
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.
For 1, It's not backward compatible. Added "Action Required" in the release note.
Will fix 2.
575372d
to
be33e24
Compare
@@ -510,6 +510,7 @@ func BuildAdmissionPluginInitializer(s *options.ServerRunOptions, client interna | |||
} | |||
|
|||
pluginInitializer = pluginInitializer.SetServiceResolver(serviceResolver) | |||
pluginInitializer = pluginInitializer.SetProxyTransport(proxyTransport) |
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 was kinda hoping to combine the service resolver with this proxy transport. But maybe it's not important. hm.
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.
Do you want them to be combined because both of them are needed iff an admission plugin wants to contact a service provided by the user? I can put them into a single struct if you think it's necessary.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caesarxuchao, cheftako, lavalamp Associated issue: 49987 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 |
set the ServerName in the config for webhook admission plugin.
fd4d25b
to
856a1db
Compare
Rebased and squashed. Adding back the label. |
/retest |
3 similar comments
/retest |
/retest |
/retest |
@caesarxuchao: 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. 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. I understand the commands that are listed here. |
Automatic merge from submit-queue (batch tested with PRs 51824, 50476, 52451, 52009, 52237) |
@caesarxuchao: Could we cherry pick this into 1.7 ? |
Dial
function to thetransport.Config
TLSConfg.ServerName
.I tested it in my gke setup. I don't have time to implement an e2e test before 1.8 release. I think it's ok to add the test later, because i) the change only affects the alpha webhook admission feature, and ii) the webhook feature is unusable without the fix. That said, it's up to my reviewer to decide.
Filed #52368 for the missing e2e test.
( The second commit is #52372, which is just a cleanup of client configuration in e2e tests. It removed a function that marshalled the client config to json and then unmarshalled it. It is a prerequisite of this PR, because this PR added the
Dial
function to the config which is not json marshallable.)