Skip to content

Commit 27fadc7

Browse files
authored
Merge pull request #2261 from robscott/v0.8.0-fixes
Addressing v0.8.0 API Review feedback
2 parents f74a204 + 2966570 commit 27fadc7

14 files changed

+687
-567
lines changed

apis/v1alpha2/grpcroute_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ type GRPCRouteRule struct {
226226
// Specifying the same filter multiple times is not supported unless explicitly
227227
// indicated in the filter.
228228
//
229-
// If an implementation can not support a combinations of filters, they must clearly
229+
// If an implementation can not support a combination of filters, it must clearly
230230
// document that limitation. In cases where incompatible or unsupported
231231
// filters are specified and cause the `Accepted` condition to be set to status
232232
// `False`, implementations may use the `IncompatibleFilters` reason to specify

apis/v1beta1/gateway_types.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,20 @@ type GatewaySpec struct {
7070
// At least one Listener MUST be specified.
7171
//
7272
// Each listener in a Gateway must have a unique combination of Hostname,
73-
// Port, and Protocol. Below combinations are considered Core and MUST be
74-
// supported:
73+
// Port, and Protocol.
74+
//
75+
// Within the HTTP Conformance Profile, the below combinations of port and
76+
// protocol are considered Core and MUST be supported:
7577
//
7678
// 1. Port: 80, Protocol: HTTP
7779
// 2. Port: 443, Protocol: HTTPS
7880
//
79-
// Port and protocol combinations not in this list are considered Extended.
81+
// Within the TLS Conformance Profile, the below combinations of port and
82+
// protocol are considered Core and MUST be supported:
83+
//
84+
// 1. Port: 443, Protocol: TLS
85+
//
86+
// Port and protocol combinations not listed above are considered Extended.
8087
//
8188
// An implementation MAY group Listeners by Port and then collapse each
8289
// group of Listeners into a single Listener if the implementation
@@ -117,9 +124,9 @@ type GatewaySpec struct {
117124
// +listMapKey=name
118125
// +kubebuilder:validation:MinItems=1
119126
// +kubebuilder:validation:MaxItems=64
120-
// +kubebuilder:validation:XValidation:message="tls must be set for protocols ['HTTPS', 'TLS']",rule="self.all(l, l.protocol in ['HTTPS', 'TLS'] ? has(l.tls) : true)"
121-
// +kubebuilder:validation:XValidation:message="tls must be empty for protocols ['HTTP', 'TCP', 'UDP']",rule="self.all(l, l.protocol in ['HTTP', 'TCP', 'UDP'] ? !has(l.tls) : true)"
122-
// +kubebuilder:validation:XValidation:message="hostname must be empty for protocols ['TCP', 'UDP']",rule="self.all(l, l.protocol in ['TCP', 'UDP'] ? (!has(l.hostname) || l.hostname == '') : true)"
127+
// +kubebuilder:validation:XValidation:message="tls must be specified for protocols ['HTTPS', 'TLS']",rule="self.all(l, l.protocol in ['HTTPS', 'TLS'] ? has(l.tls) : true)"
128+
// +kubebuilder:validation:XValidation:message="tls must not be specified for protocols ['HTTP', 'TCP', 'UDP']",rule="self.all(l, l.protocol in ['HTTP', 'TCP', 'UDP'] ? !has(l.tls) : true)"
129+
// +kubebuilder:validation:XValidation:message="hostname must not be specified for protocols ['TCP', 'UDP']",rule="self.all(l, l.protocol in ['TCP', 'UDP'] ? (!has(l.hostname) || l.hostname == '') : true)"
123130
// +kubebuilder:validation:XValidation:message="Listener name must be unique within the Gateway",rule="self.all(l1, self.exists_one(l2, l1.name == l2.name))"
124131
// +kubebuilder:validation:XValidation:message="Combination of port, protocol and hostname must be unique for each listener",rule="self.all(l1, self.exists_one(l2, l1.port == l2.port && l1.protocol == l2.protocol && (has(l1.hostname) && has(l2.hostname) ? l1.hostname == l2.hostname : true)))"
125132
Listeners []Listener `json:"listeners"`
@@ -301,7 +308,7 @@ const (
301308

302309
// GatewayTLSConfig describes a TLS configuration.
303310
//
304-
// +kubebuilder:validation:XValidation:message="certificateRefs must be set and not empty when TLSModeType is Terminate",rule="self.mode == 'Terminate' ? size(self.certificateRefs) > 0 : true"
311+
// +kubebuilder:validation:XValidation:message="certificateRefs must be specified when TLSModeType is Terminate",rule="self.mode == 'Terminate' ? size(self.certificateRefs) > 0 : true"
305312
type GatewayTLSConfig struct {
306313
// Mode defines the TLS behavior for the TLS session initiated by the client.
307314
// There are two possible modes:

apis/v1beta1/httproute_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type HTTPRouteList struct {
5656
type HTTPRouteSpec struct {
5757
CommonRouteSpec `json:",inline"`
5858

59-
// Hostnames defines a set of hostname that should match against the HTTP Host
59+
// Hostnames defines a set of hostnames that should match against the HTTP Host
6060
// header to select a HTTPRoute used to process the request. Implementations
6161
// MUST ignore any port value specified in the HTTP Host header while
6262
// performing a match and (absent of any applicable header modification
@@ -866,9 +866,9 @@ const (
866866

867867
// HTTPPathModifier defines configuration for path modifiers.
868868
//
869-
// +kubebuilder:validation:XValidation:message="replaceFullPath must be set when type is set to 'ReplaceFullPath'",rule="self.type == 'ReplaceFullPath' ? has(self.replaceFullPath) : true"
869+
// +kubebuilder:validation:XValidation:message="replaceFullPath must be specified when type is set to 'ReplaceFullPath'",rule="self.type == 'ReplaceFullPath' ? has(self.replaceFullPath) : true"
870870
// +kubebuilder:validation:XValidation:message="type must be 'ReplaceFullPath' when replaceFullPath is set",rule="has(self.replaceFullPath) ? self.type == 'ReplaceFullPath' : true"
871-
// +kubebuilder:validation:XValidation:message="replacePrefixMatch must be set when type is set to 'ReplacePrefixMatch'",rule="self.type == 'ReplacePrefixMatch' ? has(self.replacePrefixMatch) : true"
871+
// +kubebuilder:validation:XValidation:message="replacePrefixMatch must be specified when type is set to 'ReplacePrefixMatch'",rule="self.type == 'ReplacePrefixMatch' ? has(self.replacePrefixMatch) : true"
872872
// +kubebuilder:validation:XValidation:message="type must be 'ReplacePrefixMatch' when replacePrefixMatch is set",rule="has(self.replacePrefixMatch) ? self.type == 'ReplacePrefixMatch' : true"
873873
type HTTPPathModifier struct {
874874
// Type defines the type of path modifier. Additional types may be

apis/v1beta1/shared_types.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
// with "Core" support:
2626
//
2727
// * Gateway (Gateway conformance profile)
28-
// * Service (Mesh conformance profile)
28+
// * Service (Mesh conformance profile, experimental, ClusterIP Services only)
2929
//
3030
// This API may be extended in the future to support additional kinds of parent
3131
// resources.
@@ -49,7 +49,7 @@ type ParentReference struct {
4949
// There are two kinds of parent resources with "Core" support:
5050
//
5151
// * Gateway (Gateway conformance profile)
52-
// * Service (Mesh conformance profile)
52+
// * Service (Mesh conformance profile, experimental, ClusterIP Services only)
5353
//
5454
// Support for other resources is Implementation-Specific.
5555
//
@@ -92,6 +92,11 @@ type ParentReference struct {
9292
// * Gateway: Listener Name. When both Port (experimental) and SectionName
9393
// are specified, the name and port of the selected listener must match
9494
// both specified values.
95+
// * Service: Port Name. When both Port (experimental) and SectionName
96+
// are specified, the name and port of the selected listener must match
97+
// both specified values. Note that attaching Routes to Services as Parents
98+
// is part of experimental Mesh support and is not supported for any other
99+
// purpose.
95100
//
96101
// Implementations MAY choose to support attaching Routes to other resources.
97102
// If that is the case, they MUST clearly document how SectionName is
@@ -162,7 +167,7 @@ type CommonRouteSpec struct {
162167
// There are two kinds of parent resources with "Core" support:
163168
//
164169
// * Gateway (Gateway conformance profile)
165-
// * Service (Mesh conformance profile)
170+
// * Service (Mesh conformance profile, experimental, ClusterIP Services only)
166171
//
167172
// This API may be extended in the future to support additional kinds of parent
168173
// resources.

0 commit comments

Comments
 (0)