Skip to content

Commit 35cc7d5

Browse files
authored
Merge pull request #360 from robscott/resource-kind
Changing Resource to Kind, Removing Defaults for Group and Kind
2 parents ddef2ea + dd614ae commit 35cc7d5

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
@@ -67,48 +67,15 @@ type BackendPolicySpec struct {
6767
// BackendRef identifies an API object within a known namespace that defaults
6868
// group to core and resource to services if unspecified.
6969
type BackendRef struct {
70-
// Group is the group of the referent. Omitting the value or specifying
71-
// the empty string indicates the core API group. For example, use the
72-
// following to specify a service:
73-
//
74-
// fooRef:
75-
// resource: services
76-
// name: myservice
77-
//
78-
// Otherwise, if the core API group is not desired, specify the desired
79-
// group:
80-
//
81-
// fooRef:
82-
// group: acme.io
83-
// resource: foos
84-
// name: myfoo
85-
//
86-
// +kubebuilder:default=core
70+
// Group is the group of the referent.
8771
// +kubebuilder:validation:MaxLength=253
88-
Group string `json:"group,omitempty"`
72+
Group string `json:"group"`
8973

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

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

@@ -136,7 +103,7 @@ type BackendTLSConfig struct {
136103
// Support: Extended
137104
//
138105
// +optional
139-
ClientCertificateRef *CertificateObjectReference `json:"clientCertificateRef,omitempty"`
106+
ClientCertificateRef *LocalObjectReference `json:"clientCertificateRef,omitempty"`
140107

141108
// CertificateAuthorityRef is a reference to a resource that includes
142109
// trusted CA certificates for the associated backends. If an entry in this
@@ -152,7 +119,7 @@ type BackendTLSConfig struct {
152119
// Support: Extended
153120
//
154121
// +optional
155-
CertificateAuthorityRef *CertificateObjectReference `json:"certificateAuthorityRef,omitempty"`
122+
CertificateAuthorityRef *LocalObjectReference `json:"certificateAuthorityRef,omitempty"`
156123

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

apis/v1alpha1/gateway_types.go

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

383383
// RouteOverride dictates if TLS settings can be configured
384384
// via Routes or not.
@@ -421,12 +421,6 @@ const (
421421
TLSModePassthrough TLSModeType = "Passthrough"
422422
)
423423

424-
// CertificateObjectReference identifies a certificate object within a known
425-
// namespace.
426-
//
427-
// +k8s:deepcopy-gen=false
428-
type CertificateObjectReference = SecretsDefaultLocalObjectReference
429-
430424
// RouteBindingSelector defines a schema for associating routes with the Gateway.
431425
// If NamespaceSelector and RouteSelector are defined, only routes matching both
432426
// selectors are associated with the Gateway.
@@ -453,7 +447,7 @@ type RouteBindingSelector struct {
453447
// For example, use the following to select an HTTPRoute:
454448
//
455449
// routes:
456-
// resource: httproutes
450+
// kind: HTTPRoute
457451
//
458452
// Otherwise, if an alternative API group is desired, specify the desired
459453
// group:
@@ -468,19 +462,17 @@ type RouteBindingSelector struct {
468462
// +kubebuilder:validation:MinLength=1
469463
// +kubebuilder:validation:MaxLength=253
470464
Group string `json:"group,omitempty"`
471-
// Resource is the API resource name of the route resource to select.
465+
// Kind is the kind of the route resource to select.
472466
//
473-
// Resource MUST correspond to route resources that are compatible with the
467+
// Kind MUST correspond to kinds of routes that are compatible with the
474468
// application protocol specified in the Listener's Protocol field.
475469
//
476470
// If an implementation does not support or recognize this
477471
// resource type, it SHOULD raise a "ConditionInvalidRoutes"
478472
// condition for the affected Listener.
479473
//
480474
// Support: Core
481-
//
482-
// +kubebuilder:validation:MaxLength=253
483-
Resource string `json:"resource"`
475+
Kind string `json:"kind"`
484476
}
485477

486478
// 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
@@ -136,7 +136,7 @@ type RouteTLSConfig struct {
136136
// Support: Implementation-specific (Other resource types)
137137
//
138138
// +required
139-
CertificateRef CertificateObjectReference `json:"certificateRef"`
139+
CertificateRef LocalObjectReference `json:"certificateRef"`
140140
}
141141

142142
// 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
@@ -16,111 +16,16 @@ limitations under the License.
1616

1717
package v1alpha1
1818

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