@@ -18,44 +18,11 @@ package v1alpha2
18
18
19
19
import v1 "sigs.k8s.io/gateway-api/apis/v1"
20
20
21
- // ParentReference identifies an API object (usually a Gateway) that can be considered
22
- // a parent of this resource (usually a route). The only kind of parent resource
23
- // with "Core" support is Gateway. This API may be extended in the future to
24
- // support additional kinds of parent resources, such as HTTPRoute.
25
- //
26
- // Note that there are specific rules for ParentRefs which cross namespace
27
- // boundaries. Cross-namespace references are only valid if they are explicitly
28
- // allowed by something in the namespace they are referring to. For example:
29
- // Gateway has the AllowedRoutes field, and ReferenceGrant provides a
30
- // generic way to enable any other kind of cross-namespace reference.
31
- //
32
- // The API object must be valid in the cluster; the Group and Kind must
33
- // be registered in the cluster for this reference to be valid.
34
- // +k8s:deepcopy-gen=false
35
21
type ParentReference = v1.ParentReference
36
-
37
- // CommonRouteSpec defines the common attributes that all Routes MUST include
38
- // within their spec.
39
- // +k8s:deepcopy-gen=false
40
22
type CommonRouteSpec = v1.CommonRouteSpec
41
-
42
- // PortNumber defines a network port.
43
23
type PortNumber = v1.PortNumber
44
-
45
- // BackendRef defines how a Route should forward a request to a Kubernetes
46
- // resource.
47
- //
48
- // Note that when a namespace different than the local namespace is specified, a
49
- // ReferenceGrant object is required in the referent namespace to allow that
50
- // namespace's owner to accept the reference. See the ReferenceGrant
51
- // documentation for details.
52
- // +k8s:deepcopy-gen=false
53
24
type BackendRef = v1.BackendRef
54
-
55
- // RouteConditionType is a type of condition for a route.
56
25
type RouteConditionType = v1.RouteConditionType
57
-
58
- // RouteConditionReason is a reason for a route condition.
59
26
type RouteConditionReason = v1.RouteConditionReason
60
27
61
28
const (
@@ -140,214 +107,19 @@ const (
140
107
RouteReasonBackendNotFound RouteConditionReason = "BackendNotFound"
141
108
)
142
109
143
- // RouteParentStatus describes the status of a route with respect to an
144
- // associated Parent.
145
- // +k8s:deepcopy-gen=false
146
110
type RouteParentStatus = v1.RouteParentStatus
147
-
148
- // RouteStatus defines the common attributes that all Routes MUST include within
149
- // their status.
150
- // +k8s:deepcopy-gen=false
151
111
type RouteStatus = v1.RouteStatus
152
-
153
- // Hostname is the fully qualified domain name of a network host. This matches
154
- // the RFC 1123 definition of a hostname with 2 notable exceptions:
155
- //
156
- // 1. IPs are not allowed.
157
- // 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
158
- // label must appear by itself as the first label.
159
- //
160
- // Hostname can be "precise" which is a domain name without the terminating
161
- // dot of a network host (e.g. "foo.example.com") or "wildcard", which is a
162
- // domain name prefixed with a single wildcard label (e.g. `*.example.com`).
163
- //
164
- // Note that as per RFC1035 and RFC1123, a *label* must consist of lower case
165
- // alphanumeric characters or '-', and must start and end with an alphanumeric
166
- // character. No other punctuation is allowed.
167
- //
168
- // +kubebuilder:validation:MinLength=1
169
- // +kubebuilder:validation:MaxLength=253
170
- // +kubebuilder:validation:Pattern=`^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
171
112
type Hostname = v1.Hostname
172
-
173
- // PreciseHostname is the fully qualified domain name of a network host. This
174
- // matches the RFC 1123 definition of a hostname with 1 notable exception that
175
- // numeric IP addresses are not allowed.
176
- //
177
- // Note that as per RFC1035 and RFC1123, a *label* must consist of lower case
178
- // alphanumeric characters or '-', and must start and end with an alphanumeric
179
- // character. No other punctuation is allowed.
180
- //
181
- // +kubebuilder:validation:MinLength=1
182
- // +kubebuilder:validation:MaxLength=253
183
- // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
184
113
type PreciseHostname = v1.PreciseHostname
185
-
186
- // Group refers to a Kubernetes Group. It must either be an empty string or a
187
- // RFC 1123 subdomain.
188
- //
189
- // This validation is based off of the corresponding Kubernetes validation:
190
- // https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208
191
- //
192
- // Valid values include:
193
- //
194
- // * "" - empty string implies core Kubernetes API group
195
- // * "networking.k8s.io"
196
- // * "foo.example.com"
197
- //
198
- // Invalid values include:
199
- //
200
- // * "example.com/bar" - "/" is an invalid character
201
- //
202
- // +kubebuilder:validation:MaxLength=253
203
- // +kubebuilder:validation:Pattern=`^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
204
114
type Group = v1.Group
205
-
206
- // Kind refers to a Kubernetes Kind.
207
- //
208
- // Valid values include:
209
- //
210
- // * "Service"
211
- // * "HTTPRoute"
212
- //
213
- // Invalid values include:
214
- //
215
- // * "invalid/kind" - "/" is an invalid character
216
- //
217
- // +kubebuilder:validation:MinLength=1
218
- // +kubebuilder:validation:MaxLength=63
219
- // +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$`
220
115
type Kind = v1.Kind
221
-
222
- // ObjectName refers to the name of a Kubernetes object.
223
- // Object names can have a variety of forms, including RFC1123 subdomains,
224
- // RFC 1123 labels, or RFC 1035 labels.
225
- //
226
- // +kubebuilder:validation:MinLength=1
227
- // +kubebuilder:validation:MaxLength=253
228
116
type ObjectName = v1.ObjectName
229
-
230
- // Namespace refers to a Kubernetes namespace. It must be a RFC 1123 label.
231
- //
232
- // This validation is based off of the corresponding Kubernetes validation:
233
- // https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L187
234
- //
235
- // This is used for Namespace name validation here:
236
- // https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/api/validation/generic.go#L63
237
- //
238
- // Valid values include:
239
- //
240
- // * "example"
241
- //
242
- // Invalid values include:
243
- //
244
- // * "example.com" - "." is an invalid character
245
- //
246
- // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
247
- // +kubebuilder:validation:MinLength=1
248
- // +kubebuilder:validation:MaxLength=63
249
117
type Namespace = v1.Namespace
250
-
251
- // SectionName is the name of a section in a Kubernetes resource.
252
- //
253
- // In the following resources, SectionName is interpreted as the following:
254
- //
255
- // * Gateway: Listener name
256
- // * HTTPRoute: HTTPRouteRule name
257
- // * Service: Port name
258
- //
259
- // Section names can have a variety of forms, including RFC 1123 subdomains,
260
- // RFC 1123 labels, or RFC 1035 labels.
261
- //
262
- // This validation is based off of the corresponding Kubernetes validation:
263
- // https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208
264
- //
265
- // Valid values include:
266
- //
267
- // * "example"
268
- // * "foo-example"
269
- // * "example.com"
270
- // * "foo.example.com"
271
- //
272
- // Invalid values include:
273
- //
274
- // * "example.com/bar" - "/" is an invalid character
275
- //
276
- // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
277
- // +kubebuilder:validation:MinLength=1
278
- // +kubebuilder:validation:MaxLength=253
279
118
type SectionName = v1.SectionName
280
-
281
- // GatewayController is the name of a Gateway API controller. It must be a
282
- // domain prefixed path.
283
- //
284
- // Valid values include:
285
- //
286
- // * "example.com/bar"
287
- //
288
- // Invalid values include:
289
- //
290
- // * "example.com" - must include path
291
- // * "foo.example.com" - must include path
292
- //
293
- // +kubebuilder:validation:MinLength=1
294
- // +kubebuilder:validation:MaxLength=253
295
- // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
296
119
type GatewayController = v1.GatewayController
297
-
298
- // AnnotationKey is the key of an annotation in Gateway API. This is used for
299
- // validation of maps such as TLS options. This matches the Kubernetes
300
- // "qualified name" validation that is used for annotations and other common
301
- // values.
302
- //
303
- // Valid values include:
304
- //
305
- // * example
306
- // * example.com
307
- // * example.com/path
308
- // * example.com/path.html
309
- //
310
- // Invalid values include:
311
- //
312
- // * example~ - "~" is an invalid character
313
- // * example.com. - cannot start or end with "."
314
- //
315
- // +kubebuilder:validation:MinLength=1
316
- // +kubebuilder:validation:MaxLength=253
317
- // +kubebuilder:validation:Pattern=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]/?)*$`
318
120
type AnnotationKey = v1.AnnotationKey
319
-
320
- // AnnotationValue is the value of an annotation in Gateway API. This is used
321
- // for validation of maps such as TLS options. This roughly matches Kubernetes
322
- // annotation validation, although the length validation in that case is based
323
- // on the entire size of the annotations struct.
324
- //
325
- // +kubebuilder:validation:MinLength=0
326
- // +kubebuilder:validation:MaxLength=4096
327
121
type AnnotationValue = v1.AnnotationValue
328
-
329
- // AddressType defines how a network address is represented as a text string.
330
- // This may take two possible forms:
331
- //
332
- // * A predefined CamelCase string identifier (currently limited to `IPAddress` or `Hostname`)
333
- // * A domain-prefixed string identifier (like `acme.io/CustomAddressType`)
334
- //
335
- // Values `IPAddress` and `Hostname` have Extended support.
336
- //
337
- // The `NamedAddress` value has been deprecated in favor of implementation
338
- // specific domain-prefixed strings.
339
- //
340
- // All other values, including domain-prefixed values have Implementation-specific support,
341
- // which are used in implementation-specific behaviors. Support for additional
342
- // predefined CamelCase identifiers may be added in future releases.
343
- //
344
- // +kubebuilder:validation:MinLength=1
345
- // +kubebuilder:validation:MaxLength=253
346
- // +kubebuilder:validation:Pattern=`^Hostname|IPAddress|NamedAddress|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$`
347
122
type AddressType = v1.AddressType
348
-
349
- // Duration is a string value representing a duration in time. The format is as specified
350
- // in GEP-2257, a strict subset of the syntax parsed by Golang time.ParseDuration.
351
123
type Duration = v1.Duration
352
124
353
125
const (
@@ -382,7 +154,4 @@ const (
382
154
NamedAddressType AddressType = "NamedAddress"
383
155
)
384
156
385
- // SessionPersistence defines the desired state of
386
- // SessionPersistence.
387
- // +k8s:deepcopy-gen=false
388
157
type SessionPersistence = v1.SessionPersistence
0 commit comments