Skip to content

Commit dd614ae

Browse files
committed
Changing Resource to Kind, Removing Defaults for Group and Kind
1 parent 13c001f commit dd614ae

26 files changed

+223
-715
lines changed

apis/v1alpha1/backendpolicy_types.go

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -66,48 +66,15 @@ type BackendPolicySpec struct {
6666
// BackendRef identifies an API object within a known namespace that defaults
6767
// group to core and resource to services if unspecified.
6868
type BackendRef struct {
69-
// Group is the group of the referent. Omitting the value or specifying
70-
// the empty string indicates the core API group. For example, use the
71-
// following to specify a service:
72-
//
73-
// fooRef:
74-
// resource: services
75-
// name: myservice
76-
//
77-
// Otherwise, if the core API group is not desired, specify the desired
78-
// group:
79-
//
80-
// fooRef:
81-
// group: acme.io
82-
// resource: foos
83-
// name: myfoo
84-
//
85-
// +kubebuilder:default=core
69+
// Group is the group of the referent.
8670
// +kubebuilder:validation:MaxLength=253
87-
Group string `json:"group,omitempty"`
71+
Group string `json:"group"`
8872

89-
// Resource is the API resource name of the referent. Omitting the value
90-
// or specifying the empty string indicates the services resource. For example,
91-
// use the following to specify a services resource:
92-
//
93-
// fooRef:
94-
// name: myservice
95-
//
96-
// Otherwise, if the services resource is not desired, specify the desired
97-
// group:
98-
//
99-
// fooRef:
100-
// group: acme.io
101-
// resource: foos
102-
// name: myfoo
103-
//
104-
// +kubebuilder:default=services
73+
// Kind is the kind of the referent.
10574
// +kubebuilder:validation:MaxLength=253
106-
Resource string `json:"resource,omitempty"`
75+
Kind string `json:"kind,omitempty"`
10776

10877
// Name is the name of the referent.
109-
//
110-
// +kubebuilder:validation:Required
11178
// +kubebuilder:validation:MaxLength=253
11279
Name string `json:"name"`
11380

@@ -135,7 +102,7 @@ type BackendTLSConfig struct {
135102
// Support: Extended
136103
//
137104
// +optional
138-
ClientCertificateRef *CertificateObjectReference `json:"clientCertificateRef,omitempty"`
105+
ClientCertificateRef *LocalObjectReference `json:"clientCertificateRef,omitempty"`
139106

140107
// CertificateAuthorityRef is a reference to a resource that includes
141108
// trusted CA certificates for the associated backends. If an entry in this
@@ -151,7 +118,7 @@ type BackendTLSConfig struct {
151118
// Support: Extended
152119
//
153120
// +optional
154-
CertificateAuthorityRef *CertificateObjectReference `json:"certificateAuthorityRef,omitempty"`
121+
CertificateAuthorityRef *LocalObjectReference `json:"certificateAuthorityRef,omitempty"`
155122

156123
// Options are a list of key/value pairs to give extended options to the
157124
// provider.

apis/v1alpha1/gateway_types.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ type GatewayTLSConfig struct {
376376
// Support: Implementation-specific (Other resource types)
377377
//
378378
// +optional
379-
CertificateRef CertificateObjectReference `json:"certificateRef,omitempty"`
379+
CertificateRef LocalObjectReference `json:"certificateRef,omitempty"`
380380

381381
// RouteOverride dictates if TLS settings can be configured
382382
// via Routes or not.
@@ -419,12 +419,6 @@ const (
419419
TLSModePassthrough TLSModeType = "Passthrough"
420420
)
421421

422-
// CertificateObjectReference identifies a certificate object within a known
423-
// namespace.
424-
//
425-
// +k8s:deepcopy-gen=false
426-
type CertificateObjectReference = SecretsDefaultLocalObjectReference
427-
428422
// RouteBindingSelector defines a schema for associating routes with the Gateway.
429423
// If NamespaceSelector and RouteSelector are defined, only routes matching both
430424
// selectors are associated with the Gateway.
@@ -451,7 +445,7 @@ type RouteBindingSelector struct {
451445
// For example, use the following to select an HTTPRoute:
452446
//
453447
// routes:
454-
// resource: httproutes
448+
// kind: HTTPRoute
455449
//
456450
// Otherwise, if an alternative API group is desired, specify the desired
457451
// group:
@@ -466,19 +460,17 @@ type RouteBindingSelector struct {
466460
// +kubebuilder:validation:MinLength=1
467461
// +kubebuilder:validation:MaxLength=253
468462
Group string `json:"group,omitempty"`
469-
// Resource is the API resource name of the route resource to select.
463+
// Kind is the kind of the route resource to select.
470464
//
471-
// Resource MUST correspond to route resources that are compatible with the
465+
// Kind MUST correspond to kinds of routes that are compatible with the
472466
// application protocol specified in the Listener's Protocol field.
473467
//
474468
// If an implementation does not support or recognize this
475469
// resource type, it SHOULD raise a "ConditionInvalidRoutes"
476470
// condition for the affected Listener.
477471
//
478472
// Support: Core
479-
//
480-
// +kubebuilder:validation:MaxLength=253
481-
Resource string `json:"resource"`
473+
Kind string `json:"kind"`
482474
}
483475

484476
// RouteNamespaces indicate which namespaces Routes should be selected from.

apis/v1alpha1/httproute_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ type RouteTLSConfig struct {
134134
// Support: Implementation-specific (Other resource types)
135135
//
136136
// +required
137-
CertificateRef CertificateObjectReference `json:"certificateRef"`
137+
CertificateRef LocalObjectReference `json:"certificateRef"`
138138
}
139139

140140
// HTTPRouteHostname is used to specify a hostname that should be matched by

apis/v1alpha1/local_object_reference_types.go

Lines changed: 3 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -15,111 +15,16 @@ limitations under the License.
1515

1616
package v1alpha1
1717

18-
// ServicesDefaultLocalObjectReference identifies an API object within a
19-
// known namespace that defaults group to core and resource to services
20-
// if unspecified.
21-
type ServicesDefaultLocalObjectReference struct {
22-
// Group is the group of the referent. Omitting the value or specifying
23-
// the empty string indicates the core API group. For example, use the
24-
// following to specify a service:
25-
//
26-
// fooRef:
27-
// resource: services
28-
// name: myservice
29-
//
30-
// Otherwise, if the core API group is not desired, specify the desired
31-
// group:
32-
//
33-
// fooRef:
34-
// group: acme.io
35-
// resource: foos
36-
// name: myfoo
37-
//
38-
// +kubebuilder:validation:MaxLength=253
39-
// +kubebuilder:default=core
40-
Group string `json:"group,omitempty"`
41-
// Resource is the API resource name of the referent. Omitting the value
42-
// or specifying the empty string indicates the services resource. For example,
43-
// use the following to specify a services resource:
44-
//
45-
// fooRef:
46-
// name: myservice
47-
//
48-
// Otherwise, if the services resource is not desired, specify the desired
49-
// group:
50-
//
51-
// fooRef:
52-
// group: acme.io
53-
// resource: foos
54-
// name: myfoo
55-
//
56-
// +kubebuilder:validation:MaxLength=253
57-
// +kubebuilder:default=services
58-
Resource string `json:"resource,omitempty"`
59-
// Name is the name of the referent.
60-
//
61-
// +kubebuilder:validation:MinLength=1
62-
// +kubebuilder:validation:MaxLength=253
63-
Name string `json:"name"`
64-
}
65-
6618
// LocalObjectReference identifies an API object within a known namespace.
6719
type LocalObjectReference struct {
68-
// Group is the API group name of the referent
20+
// Group is the group of the referent.
6921
// +kubebuilder:validation:MinLength=1
7022
// +kubebuilder:validation:MaxLength=253
7123
Group string `json:"group"`
72-
// Resource is the API resource name of the referent.
24+
// Kind is kind of the referent.
7325
// +kubebuilder:validation:MinLength=1
7426
// +kubebuilder:validation:MaxLength=253
75-
Resource string `json:"resource"`
76-
// Name is the name of the referent.
77-
// +kubebuilder:validation:MinLength=1
78-
// +kubebuilder:validation:MaxLength=253
79-
Name string `json:"name"`
80-
}
81-
82-
// SecretsDefaultLocalObjectReference identifies an API object within a
83-
// known namespace that defaults group to core and resource to secrets
84-
// if unspecified.
85-
type SecretsDefaultLocalObjectReference struct {
86-
// Group is the group of the referent. Omitting the value or specifying
87-
// the empty string indicates the core API group. For example, use the
88-
// following to specify a secrets resource:
89-
//
90-
// fooRef:
91-
// resource: secrets
92-
// name: mysecret
93-
//
94-
// Otherwise, if the core API group is not desired, specify the desired
95-
// group:
96-
//
97-
// fooRef:
98-
// group: acme.io
99-
// resource: foos
100-
// name: myfoo
101-
//
102-
// +kubebuilder:validation:MaxLength=253
103-
// +kubebuilder:default=core
104-
Group string `json:"group,omitempty"`
105-
// Resource is the API resource name of the referent. Omitting the value
106-
// or specifying the empty string indicates the secrets resource. For
107-
// example, use the following to specify a secrets resource:
108-
//
109-
// fooRef:
110-
// name: mysecret
111-
//
112-
// Otherwise, if the secrets resource is not desired, specify the desired
113-
// group:
114-
//
115-
// fooRef:
116-
// group: acme.io
117-
// resource: foos
118-
// name: myfoo
119-
//
120-
// +kubebuilder:validation:MaxLength=253
121-
// +kubebuilder:default=secrets
122-
Resource string `json:"resource,omitempty"`
27+
Kind string `json:"kind"`
12328
// Name is the name of the referent.
12429
// +kubebuilder:validation:MinLength=1
12530
// +kubebuilder:validation:MaxLength=253

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 2 additions & 32 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_backendpolicies.yaml

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

0 commit comments

Comments
 (0)