@@ -37,15 +37,18 @@ type Gateway struct {
37
37
metav1.TypeMeta `json:",inline"`
38
38
metav1.ObjectMeta `json:"metadata,omitempty"`
39
39
40
+ // Spec defines the desired state of Gateway.
40
41
Spec GatewaySpec `json:"spec,omitempty"`
41
42
43
+ // Status defines the current state of Gateway.
44
+ //
42
45
// +kubebuilder:default={conditions: {{type: "Scheduled", status: "False", reason:"NotReconciled", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
43
46
Status GatewayStatus `json:"status,omitempty"`
44
47
}
45
48
46
49
// +kubebuilder:object:root=true
47
50
48
- // GatewayList contains a list of Gateway
51
+ // GatewayList contains a list of Gateway.
49
52
type GatewayList struct {
50
53
metav1.TypeMeta `json:",inline"`
51
54
metav1.ListMeta `json:"metadata,omitempty"`
@@ -61,6 +64,7 @@ type GatewayList struct {
61
64
type GatewaySpec struct {
62
65
// GatewayClassName used for this Gateway. This is the name of a
63
66
// GatewayClass resource.
67
+ //
64
68
// +kubebuilder:validation:MinLength=1
65
69
// +kubebuilder:validation:MaxLength=253
66
70
GatewayClassName string `json:"gatewayClassName"`
@@ -293,8 +297,9 @@ type TLSOverridePolicy struct {
293
297
//
294
298
// Support: Core
295
299
//
300
+ // +optional
296
301
// +kubebuilder:default=Deny
297
- Certificate TLSRouteOverrideType `json:"certificate"`
302
+ Certificate TLSRouteOverrideType `json:"certificate,omitempty "`
298
303
}
299
304
300
305
// GatewayTLSConfig describes a TLS configuration.
@@ -319,6 +324,7 @@ type GatewayTLSConfig struct {
319
324
//
320
325
// Support: Core
321
326
//
327
+ // +optional
322
328
// +kubebuilder:default=Terminate
323
329
Mode TLSModeType `json:"mode,omitempty"`
324
330
@@ -338,7 +344,7 @@ type GatewayTLSConfig struct {
338
344
// Support: Implementation-specific (Other resource types)
339
345
//
340
346
// +optional
341
- CertificateRef LocalObjectReference `json:"certificateRef,omitempty"`
347
+ CertificateRef * LocalObjectReference `json:"certificateRef,omitempty"`
342
348
343
349
// RouteOverride dictates if TLS settings can be configured
344
350
// via Routes or not.
@@ -349,6 +355,7 @@ type GatewayTLSConfig struct {
349
355
//
350
356
// Support: Core
351
357
//
358
+ // +optional
352
359
// +kubebuilder:default={certificate:Deny}
353
360
RouteOverride TLSOverridePolicy `json:"routeOverride,omitempty"`
354
361
@@ -363,7 +370,7 @@ type GatewayTLSConfig struct {
363
370
// Support: Implementation-specific.
364
371
//
365
372
// +optional
366
- Options map [string ]string `json:"options"`
373
+ Options map [string ]string `json:"options,omitempty "`
367
374
}
368
375
369
376
// TLSModeType type defines behavior of gateway with TLS protocol.
@@ -391,8 +398,10 @@ type RouteBindingSelector struct {
391
398
// default.
392
399
//
393
400
// Support: Core
394
- // +kubebuilder:default={from: "Same"}
395
- Namespaces * RouteNamespaces `json:"namespaces,omitempty"`
401
+ //
402
+ // +optional
403
+ // +kubebuilder:default={from: Same}
404
+ Namespaces RouteNamespaces `json:"namespaces,omitempty"`
396
405
// Selector specifies a set of route labels used for selecting
397
406
// routes to associate with the Gateway. If this Selector is defined,
398
407
// only routes matching the Selector are associated with the Gateway.
@@ -418,6 +427,7 @@ type RouteBindingSelector struct {
418
427
//
419
428
// Support: Core
420
429
//
430
+ // +optional
421
431
// +kubebuilder:default=networking.x-k8s.io
422
432
// +kubebuilder:validation:MinLength=1
423
433
// +kubebuilder:validation:MaxLength=253
@@ -436,8 +446,8 @@ type RouteBindingSelector struct {
436
446
}
437
447
438
448
// RouteSelectType specifies where Routes should be selected by a Gateway.
449
+ //
439
450
// +kubebuilder:validation:Enum=All;Selector;Same
440
- // +kubebuilder:default=Same
441
451
type RouteSelectType string
442
452
443
453
const (
@@ -462,6 +472,9 @@ type RouteNamespaces struct {
462
472
// * Same: Only Routes in the same namespace may be used by this Gateway.
463
473
//
464
474
// Support: Core
475
+ //
476
+ // +optional
477
+ // +kubebuilder:default=Same
465
478
From RouteSelectType `json:"from,omitempty"`
466
479
467
480
// Selector must be specified when From is set to "Selector". In that case,
@@ -480,6 +493,7 @@ type GatewayAddress struct {
480
493
//
481
494
// Support: Extended
482
495
//
496
+ // +optional
483
497
// +kubebuilder:default=IPAddress
484
498
Type AddressType `json:"type,omitempty"`
485
499
@@ -540,7 +554,7 @@ type GatewayStatus struct {
540
554
//
541
555
// +optional
542
556
// +kubebuilder:validation:MaxItems=16
543
- Addresses []GatewayAddress `json:"addresses"`
557
+ Addresses []GatewayAddress `json:"addresses,omitempty "`
544
558
545
559
// Conditions describe the current conditions of the Gateway.
546
560
//
@@ -554,6 +568,7 @@ type GatewayStatus struct {
554
568
// * "Scheduled"
555
569
// * "Ready"
556
570
//
571
+ // +optional
557
572
// +listType=map
558
573
// +listMapKey=type
559
574
// +kubebuilder:validation:MaxItems=8
0 commit comments