@@ -59,8 +59,7 @@ type GatewaySpec struct {
59
59
}
60
60
61
61
type AllowedListeners struct {
62
- // TODO - discuss changing this to Same in the future
63
- // +kubebuilder:default={from: None}
62
+ // +kubebuilder:default={from:Same}
64
63
Namespaces *ListenerNamespaces ` json:"namespaces,omitempty"`
65
64
}
66
65
@@ -70,12 +69,21 @@ type ListenerNamespaces struct {
70
69
// values are:
71
70
//
72
71
// * Same: Only ListenerSets in the same namespace may be attached to this Gateway.
72
+ // * Selector: ListenerSets in namespaces selected by the selector may be attached to this Gateway.:w
73
+ // * All: ListenerSets in all namespaces may be attached to this Gateway.
73
74
// * None: Only listeners defined in the Gateway's spec are allowed
74
75
//
75
76
// +optional
76
77
// +kubebuilder:default=None
77
- // +kubebuilder:validation:Enum=Same;None
78
+ // +kubebuilder:validation:Enum=Same;None;Selector;All
78
79
From *FromNamespaces ` json:"from,omitempty"`
80
+
81
+ // Selector must be specified when From is set to "Selector". In that case,
82
+ // only ListenerSets in Namespaces matching this Selector will be selected by this
83
+ // Gateway. This field is ignored for other values of "From".
84
+ //
85
+ // +optional
86
+ Selector *metav1.LabelSelector ` json:"selector,omitempty"`
79
87
}
80
88
81
89
// ListenerSet defines a set of additional listeners to attach to an existing Gateway.
@@ -93,7 +101,7 @@ type ListenerSet struct {
93
101
// ListenerSetSpec defines the desired state of a ListenerSet.
94
102
type ListenerSetSpec struct {
95
103
// ParentRef references the Gateway that the listeners are attached to.
96
- ParentRef ParentGatewayReference ` json:"parentRef,omitempty "`
104
+ ParentRef ParentGatewayReference ` json:"parentRef"`
97
105
98
106
// Listeners associated with this ListenerSet. Listeners define
99
107
// logical endpoints that are bound on this referenced parent Gateway's addresses.
@@ -118,9 +126,11 @@ type ListenerSetSpec struct {
118
126
// network connections.
119
127
type ListenerEntry struct {
120
128
// Name is the name of the Listener. This name MUST be unique within a
121
- // Gateway .
129
+ // ListenerSet .
122
130
//
123
- // Support: Core
131
+ // Name is not required to be unique across a Gateway and ListenerSets.
132
+ // Routes can attach to a Listener by having a ListenerSet as a parentRef
133
+ // and setting the SectionName
124
134
Name SectionName ` json:"name"`
125
135
126
136
// Hostname specifies the virtual hostname to match for protocol types that
@@ -148,8 +158,6 @@ type ListenerEntry struct {
148
158
// as a suffix match. That means that a match for `*.example.com` would match
149
159
// both `test.example.com`, and `foo.test.example.com`, but not `example.com`.
150
160
//
151
- // Support: Core
152
- //
153
161
// +optional
154
162
Hostname *Hostname ` json:"hostname,omitempty"`
155
163
@@ -309,6 +317,10 @@ type ParentGatewayReference struct {
309
317
310
318
// Name is the name of the referent.
311
319
Name ObjectName ` json:"name"`
320
+
321
+ // Namespace is the name of the referent.
322
+ // +optional
323
+ Name *ObjectName ` json:"namespace"`
312
324
}
313
325
```
314
326
0 commit comments