-
Notifications
You must be signed in to change notification settings - Fork 480
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
Update CRDs as per GEP-3155 #3291
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mkosieradzki The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @mkosieradzki. 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-sigs/prow repository. |
/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.
Thanks @mkosieradzki!
@@ -126,11 +141,50 @@ type BackendTLSPolicyValidation struct { | |||
// backends: | |||
// | |||
// 1. Hostname MUST be used as the SNI to connect to the backend (RFC 6066). | |||
// 2. Hostname MUST be used for authentication and MUST match the certificate | |||
// served by the matching backend. | |||
// 2. Only if SubjectAltNames is not specified, Hostname MUST be used for |
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.
Tiny nit:
// 2. Only if SubjectAltNames is not specified, Hostname MUST be used for | |
// 2. If SubjectAltNames is not specified, Hostname MUST be used for |
// Support: Core | ||
// | ||
// +optional | ||
Hostname v1.PreciseHostname `json:"hostname,omitempty"` |
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.
Not an expert here, but it seems like a wildcard hostname is at least theoretically possible (https://stackoverflow.com/a/21496451). That would mean using the more generic type that also allows wildcards:
gateway-api/apis/v1/shared_types.go
Line 523 in f7d4a87
type Hostname string |
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.
Not an expert as well but I think I agree here. That means that in the SANs we will be able to specify wildcards but we are keeping the Hostname under BackendTLSPolicySpec precise (we have to cause if SubjectAltNames
is empty Hostname MUST be used as the SNI to connect to the backend.
Just clarifying my understanding
// Support: Core | ||
// | ||
// +optional | ||
URI string `json:"uri,omitempty"` |
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.
Seems like we need some kind of regex validation here, similar in concept to what we've added for the hostname types.
// +kubebuilder:validation:XValidation:message="must contain Hostname, if Type is set to Hostname",rule="!(self.Type == "Hostname" && has(self.Hostname) && self.Hostname != \"\")" | ||
// +kubebuilder:validation:XValidation:message="must not contain Hostname, if Type is not set to Hostname",rule="self.Type != "Hostname" && has(self.Hostname) && self.Hostname != \"\"" | ||
// +kubebuilder:validation:XValidation:message="must contain URI, if Type is set to URI",rule="!(self.Type == "URI" && has(self.URI) && self.HostName != \"\")" | ||
// +kubebuilder:validation:XValidation:message="must not contain URI, if Type is not set to URI",rule="self.Type != "URI" && has(self.URI) && self.URI != \"\"" |
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.
Recommend adding some basic CEL test coverage, similar to #3283
@mkosieradzki: The following test 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-sigs/prow repository. I understand the commands that are listed here. |
/assign |
this moved to #3304 |
/kind gep
What this PR does / why we need it:
Updates CRDs as per GEP-3155
Does this PR introduce a user-facing change?: