Skip to content

Commit d056a47

Browse files
committed
Use fooRef naming convention for object references
Rename fields that are object references in order to follow the community API conventions. * api/v1alpha1/gateway_types.go (Listener): Rename "extension" field to "extensionRef". (ListenerTLS): Rename "certificates" field to "certificateRefs". * api/v1alpha1/gatewayclass_types.go (GatewayClassSpec): Rename "parameters" field to "parametersRef". * api/v1alpha1/httproute_types.go (HTTPRouteHost, HTTPRouteMatch) (HTTPRouteFilter, HTTPRouteAction): Rename "extension" fields to "extensionRef". (HTTPRouteAction): Rename "forwardTo" field to "forwardTargetRef". (HTTPRouteStatus): Rename "gateways" field to "gatewayRefs". * api/v1alpha1/generated.pb.go: * api/v1alpha1/generated.proto: * api/v1alpha1/zz_generated.deepcopy.go: * config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml: * config/crd/bases/networking.x-k8s.io_gateways.yaml: * config/crd/bases/networking.x-k8s.io_httproutes.yaml: Regenerate.
1 parent 92c63e6 commit d056a47

9 files changed

+330
-329
lines changed

api/v1alpha1/gateway_types.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ type Listener struct {
115115
//
116116
// +optional
117117
TLS *ListenerTLS `json:"tls,omitempty" protobuf:"bytes,5,opt,name=tls"`
118-
// Extension for this Listener. The resource may be "configmaps" or an
119-
// implementation-defined resource (for example, resource "mylisteners"
120-
// in group "networking.acme.io"). Omitting or specifying the empty
121-
// string for both the resource and group indicates that the resource is
122-
// "configmaps". If the referent cannot be found, the listener's
123-
// "InvalidListener" status condition will be true.
118+
// ExtensionRef for this Listener. The resource may be "configmaps" or
119+
// an implementation-defined resource (for example, resource
120+
// "mylisteners" in group "networking.acme.io"). Omitting or specifying
121+
// the empty string for both the resource and group indicates that the
122+
// resource is "configmaps". If the referent cannot be found, the
123+
// listener's "InvalidListener" status condition will be true.
124124
//
125125
// Support: custom.
126126
// +optional
127-
Extension *ListenerExtensionObjectReference `json:"extension,omitempty" protobuf:"bytes,6,opt,name=extension"`
127+
ExtensionRef *ListenerExtensionObjectReference `json:"extensionRef,omitempty" protobuf:"bytes,6,opt,name=extensionRef"`
128128
}
129129

130130
// AddressType defines how a network address is represented as a text string.
@@ -180,7 +180,7 @@ const (
180180
// - aws: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies
181181
// - azure: https://docs.microsoft.com/en-us/azure/app-service/configure-ssl-bindings#enforce-tls-1112
182182
type ListenerTLS struct {
183-
// Certificates is a list of references to Kubernetes objects that each
183+
// CertificateRefs is a list of references to Kubernetes objects that each
184184
// contain an identity certificate that is bound to the listener. The
185185
// host name in a TLS SNI client hello message is used for certificate
186186
// matching and route host name selection. The SNI server_name must
@@ -196,7 +196,7 @@ type ListenerTLS struct {
196196
// Support: Implementation-specific (Other resource types)
197197
//
198198
// +required
199-
Certificates []CertificateObjectReference `json:"certificates,omitempty" protobuf:"bytes,1,rep,name=certificates"`
199+
CertificateRefs []CertificateObjectReference `json:"certificateRefs,omitempty" protobuf:"bytes,1,rep,name=certificateRefs"`
200200
// MinimumVersion of TLS allowed. It is recommended to use one of
201201
// the TLS_* constants above. Note: this is not strongly
202202
// typed to allow implementation-specific versions to be used without

api/v1alpha1/gatewayclass_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ type GatewayClassSpec struct {
110110
//
111111
// +optional
112112
// +protobuf=false
113-
ParametersRef *GatewayClassParametersObjectReference `json:"parameters,omitempty" protobuf:"bytes,4,opt,name=parametersRef"`
113+
ParametersRef *GatewayClassParametersObjectReference `json:"parametersRef,omitempty" protobuf:"bytes,4,opt,name=parametersRef"`
114114
}
115115

116116
// GatewayClassParametersObjectReference identifies a parameters object for a

api/v1alpha1/generated.pb.go

Lines changed: 212 additions & 211 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha1/generated.proto

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha1/httproute_types.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type HTTPRouteHost struct {
5555
// Rules are a list of HTTP matchers, filters and actions.
5656
Rules []HTTPRouteRule `json:"rules" protobuf:"bytes,2,rep,name=rules"`
5757

58-
// Extension is an optional, implementation-specific extension to the
58+
// ExtensionRef is an optional, implementation-specific extension to the
5959
// "host" block. The resource may be "configmaps" (omit or specify the
6060
// empty string for the group) or an implementation-defined resource
6161
// (for example, resource "myroutehosts" in group "networking.acme.io").
@@ -67,7 +67,7 @@ type HTTPRouteHost struct {
6767
// Support: custom
6868
//
6969
// +optional
70-
Extension *RouteHostExtensionObjectReference `json:"extension" protobuf:"bytes,3,opt,name=extension"`
70+
ExtensionRef *RouteHostExtensionObjectReference `json:"extensionRef" protobuf:"bytes,3,opt,name=extensionRef"`
7171
}
7272

7373
// HTTPRouteRule is the configuration for a given path.
@@ -125,7 +125,7 @@ type HTTPRouteMatch struct {
125125
// +optional
126126
Header map[string]string `json:"header" protobuf:"bytes,4,rep,name=header"`
127127

128-
// Extension is an optional, implementation-specific extension to the
128+
// ExtensionRef is an optional, implementation-specific extension to the
129129
// "match" behavior. The resource may be "configmap" (use the empty
130130
// string for the group) or an implementation-defined resource (for
131131
// example, resource "myroutematchers" in group "networking.acme.io").
@@ -137,7 +137,7 @@ type HTTPRouteMatch struct {
137137
// Support: custom
138138
//
139139
// +optional
140-
Extension *RouteMatchExtensionObjectReference `json:"extension" protobuf:"bytes,5,opt,name=extension"`
140+
ExtensionRef *RouteMatchExtensionObjectReference `json:"extensionRef" protobuf:"bytes,5,opt,name=extensionRef"`
141141
}
142142

143143
// RouteMatchExtensionObjectReference identifies a route-match extension object
@@ -155,7 +155,7 @@ type HTTPRouteFilter struct {
155155
// +optional
156156
Headers *HTTPHeaderFilter `json:"headers" protobuf:"bytes,1,opt,name=headers"`
157157

158-
// Extension is an optional, implementation-specific extension to the
158+
// ExtensionRef is an optional, implementation-specific extension to the
159159
// "filter" behavior. The resource may be "configmap" (use the empty
160160
// string for the group) or an implementation-defined resource (for
161161
// example, resource "myroutefilters" in group "networking.acme.io").
@@ -167,7 +167,7 @@ type HTTPRouteFilter struct {
167167
// Support: custom
168168
//
169169
// +optional
170-
Extension *RouteFilterExtensionObjectReference `json:"extension" protobuf:"bytes,2,opt,name=extension"`
170+
ExtensionRef *RouteFilterExtensionObjectReference `json:"extensionRef" protobuf:"bytes,2,opt,name=extensionRef"`
171171
}
172172

173173
// RouteFilterExtensionObjectReference identifies a route-filter extension
@@ -220,17 +220,17 @@ type HTTPHeaderFilter struct {
220220

221221
// HTTPRouteAction is the action taken given a match.
222222
type HTTPRouteAction struct {
223-
// ForwardTo sends requests to the referenced object. The resource may
224-
// be "services" (omit or use the empty string for the group), or an
225-
// implementation may support other resources (for example, resource
226-
// "myroutetargets" in group "networking.acme.io"). Omitting or
227-
// specifying the empty string for both the resource and group indicates
228-
// that the resource is "services". If the referent cannot be found,
229-
// the "InvalidRoutes" status condition on any Gateway that includes the
230-
// HTTPRoute will be true.
231-
ForwardTo *RouteActionTargetObjectReference `json:"forwardTo" protobuf:"bytes,1,opt,name=forwardTo"`
232-
233-
// Extension is an optional, implementation-specific extension to the
223+
// ForwardTargetRef sends requests to the referenced object. The
224+
// resource may be "services" (omit or use the empty string for the
225+
// group), or an implementation may support other resources (for
226+
// example, resource "myroutetargets" in group "networking.acme.io").
227+
// Omitting or specifying the empty string for both the resource and
228+
// group indicates that the resource is "services". If the referent
229+
// cannot be found, the "InvalidRoutes" status condition on any Gateway
230+
// that includes the HTTPRoute will be true.
231+
ForwardTargetRef *RouteActionTargetObjectReference `json:"forwardTargetRef" protobuf:"bytes,1,opt,name=forwardTargetRef"`
232+
233+
// ExtensionRef is an optional, implementation-specific extension to the
234234
// "action" behavior. The resource may be "configmaps" (use the empty
235235
// string for the group) or an implementation-defined resource (for
236236
// example, resource "myrouteactions" in group "networking.acme.io").
@@ -242,7 +242,7 @@ type HTTPRouteAction struct {
242242
// Support: custom
243243
//
244244
// +optional
245-
Extension *RouteActionExtensionObjectReference `json:"extension" protobuf:"bytes,2,opt,name=extension"`
245+
ExtensionRef *RouteActionExtensionObjectReference `json:"extensionRef" protobuf:"bytes,2,opt,name=extensionRef"`
246246
}
247247

248248
// RouteActionTargetObjectReference identifies a target object for a route
@@ -265,7 +265,7 @@ type RouteHostExtensionObjectReference = LocalObjectReference
265265

266266
// HTTPRouteStatus defines the observed state of HTTPRoute.
267267
type HTTPRouteStatus struct {
268-
Gateways []GatewayObjectReference `json:"gateways" protobuf:"bytes,1,rep,name=gateways"`
268+
GatewayRefs []GatewayObjectReference `json:"gatewayRefs" protobuf:"bytes,1,rep,name=gatewayRefs"`
269269
}
270270

271271
// GatewayObjectReference identifies a Gateway object.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ spec:
146146
names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
147147
\n Support: Core"
148148
type: string
149-
parameters:
149+
parametersRef:
150150
description: "ParametersRef is a controller specific resource containing
151151
the configuration parameters corresponding to this class. This is
152152
optional if the controller does not require any additional configuration.

0 commit comments

Comments
 (0)