-
Notifications
You must be signed in to change notification settings - Fork 498
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
Webhook: validate certificateRefs when tls is set and mode is Terminate. #1460
Webhook: validate certificateRefs when tls is set and mode is Terminate. #1460
Conversation
Hi @gyohuangxin. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@mlavacca Since you created the issue, please review this PR, thanks. |
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 validation should be put into the v1alpha2
package as well.
@mlavacca Thanks for your comments, please review again. |
f705a8d
to
02e1e0d
Compare
/ok-to-test |
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.
Apart from a tiny nit related to the comment, it looks good. Thank you!
@mlavacca Thank you for your comments! |
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.
Everything looks good, the only thing is in other PRs we're trying to consolidate copied code between v1alpha2 and v1beta1. I would ask that since it appears there are no differences, just keep the v1beta1 copy of the code and tests, and include that in the v1alpha2 validation for the time being.
@shaneutt Sounds good, could you give the example PR I can refer to? |
Sure, #1412 is the most recent example. |
1160fff
to
7b2d1bb
Compare
@shaneutt I keep the v1beta1 validation code and tests, and include that in the v1alpha2 validation. Please review again, thanks. |
I'd like to, but unfortunately, I'm not a reviewer. Hence, I cannot sponsor you, as stated on the community page. |
From reading the docs, i.e. the field comments, I would say we can validate that |
Correct, but the validation to validate that |
It's OK, sorry for missing this, thanks anyway. |
I think we should add this validation here, where we already check that TLS must not be set when the protocol is |
@mlavacca Yes, it's a better place. I prefer create another issue to implement it, I will create one later. |
Signed-off-by: Huang Xin <[email protected]>
…dation to v1alpha2 Signed-off-by: Huang Xin <[email protected]>
Signed-off-by: Huang Xin <[email protected]>
Signed-off-by: Huang Xin <[email protected]>
…1alpha2 validation Signed-off-by: Huang Xin <[email protected]>
Signed-off-by: Huang Xin <[email protected]>
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gyohuangxin, mlavacca, shaneutt 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
When the TLSModeType is set to terminate, there is always the need for a valid certificate to terminate the TLS connection.
This PR validates the certificateRefs must be set and not empty when tls config is set and tls mode is terminate.
Which issue(s) this PR fixes:
Fixes #1441
Does this PR introduce a user-facing change?: