Skip to content

Commit 2911ad9

Browse files
committed
Document behavior for missing referents
For each API field that specifies an object reference, document the expected behavior when the field's referent cannot be found. * api/v1alpha1/gateway_types.go (GatewaySpec, Listener, ListenerTLS): * api/v1alpha1/gatewayclass_types.go (GatewayClassSpec): * api/v1alpha1/httproute_types.go (HTTPRouteHost, HTTPRouteMatch) (HTTPRouteFilter, HTTPRouteAction): Document behavior for missing referents.
1 parent 7ffcb7d commit 2911ad9

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

api/v1alpha1/gateway_types.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ type GatewaySpec struct {
6363
// "httproute" or "tcproute" in group "networking.x.k8s.io". However, an
6464
// implementation may support other resources.
6565
//
66+
// If a referent cannot be found, the Gateway's "InvalidRoutes" status
67+
// condition will be true.
68+
//
6669
// If unspecified, no routes will be associated to the Gateway.
6770
//
6871
// Support: Core
@@ -123,7 +126,8 @@ type Listener struct {
123126
// resource (for example, resource "mylistener" in group
124127
// "networking.acme.io"). Omitting or specifying the empty string for
125128
// both the resource and group indicates that the resource is a
126-
// configmap.
129+
// configmap. If the referent cannot be found, the listener's
130+
// "InvalidListener" status condition will be true.
127131
//
128132
// Support: custom.
129133
// +optional
@@ -191,7 +195,9 @@ type ListenerTLS struct {
191195
// an entry in this list omits or specifies the empty string for both
192196
// the group and the resource, the resource defaults to "secret". An
193197
// implementation may support other resources (for example, resource
194-
// "mycertificate" in group "networking.acme.io").
198+
// "mycertificate" in group "networking.acme.io"). If a referent cannot
199+
// be found, the listener's "InvalidListener" status condition will be
200+
// true.
195201
//
196202
// Support: Core (Kubernetes Secrets)
197203
// Support: Implementation-specific (Other resource types)

api/v1alpha1/gatewayclass_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ type GatewayClassSpec struct {
7070
// include "configmap" (omit or specify the empty string for the group
7171
// to indicate the core API group) or a custom resource (CRD). Omitting
7272
// or specifying the empty string for both the resource and group
73-
// indicates that the resource is a configmap.
73+
// indicates that the resource is a configmap. If the referent cannot
74+
// be found, the GatewayClass's "InvalidParameters" status condition
75+
// will be true.
7476
//
7577
// Support: Custom
7678
//

api/v1alpha1/httproute_types.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ type HTTPRouteHost struct {
6060
// empty string for the group) or an implementation-defined resource
6161
// (for example, resource "myroutehost" in group "networking.acme.io").
6262
// Omitting or specifying the empty string for both the resource and
63-
// group indicates that the resource is a configmap.
63+
// group indicates that the resource is a configmap. If the referent
64+
// cannot be found, the "InvalidRoute" status condition on any Gateway
65+
// that includes the HTTPRoute will be true.
6466
//
6567
// Support: custom
6668
//
@@ -128,7 +130,9 @@ type HTTPRouteMatch struct {
128130
// string for the group) or an implementation-defined resource (for
129131
// example, resource "myroutematcher" in group "networking.acme.io").
130132
// Omitting or specifying the empty string for both the resource and
131-
// group indicates that the resource is a configmap.
133+
// group indicates that the resource is a configmap. If the referent
134+
// cannot be found, the "InvalidRoute" status condition on any Gateway
135+
// that includes the HTTPRoute will be true.
132136
//
133137
// Support: custom
134138
//
@@ -156,7 +160,9 @@ type HTTPRouteFilter struct {
156160
// string for the group) or an implementation-defined resource (for
157161
// example, resource "myroutefilter" in group "networking.acme.io").
158162
// Omitting or specifying the empty string for both the resource and
159-
// group indicates that the resource is a configmap.
163+
// group indicates that the resource is a configmap. If the referent
164+
// cannot be found, the "InvalidRoute" status condition on any Gateway
165+
// that includes the HTTPRoute will be true.
160166
//
161167
// Support: custom
162168
//
@@ -219,15 +225,19 @@ type HTTPRouteAction struct {
219225
// implementation may support other resources (for example, resource
220226
// "myroutetarget" in group "networking.acme.io"). Omitting or
221227
// specifying the empty string for both the resource and group indicates
222-
// that the resource is a service.
228+
// that the resource is a service. If the referent cannot be found, the
229+
// "InvalidRoute" status condition on any Gateway that includes the
230+
// HTTPRoute will be true.
223231
ForwardTo *RouteActionTargetObjectReference `json:"forwardTo" protobuf:"bytes,1,opt,name=forwardTo"`
224232

225233
// Extension is an optional, implementation-specific extension to the
226234
// "action" behavior. The resource may be "configmap" (use the empty
227235
// string for the group) or an implementation-defined resource (for
228236
// example, resource "myrouteaction" in group "networking.acme.io").
229237
// Omitting or specifying the empty string for both the resource and
230-
// group indicates that the resource is a configmap.
238+
// group indicates that the resource is a configmap. If the referent
239+
// cannot be found, the "InvalidRoute" status condition on any Gateway
240+
// that includes the HTTPRoute will be true.
231241
//
232242
// Support: custom
233243
//

0 commit comments

Comments
 (0)