Skip to content

Commit d1370a7

Browse files
committed
Renaming ReferencePolicy to ReferenceGrant
1 parent 20683af commit d1370a7

File tree

58 files changed

+581
-573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+581
-573
lines changed

apis/v1alpha2/gateway_types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ type GatewayTLSConfig struct {
314314
// a Listener, but this behavior is implementation-specific.
315315
//
316316
// References to a resource in different namespace are invalid UNLESS there
317-
// is a ReferencePolicy in the target namespace that allows the certificate
318-
// to be attached. If a ReferencePolicy does not allow this reference, the
317+
// is a ReferenceGrant in the target namespace that allows the certificate
318+
// to be attached. If a ReferenceGrant does not allow this reference, the
319319
// "ResolvedRefs" condition MUST be set to False for this listener with the
320320
// "InvalidCertificateRef" reason.
321321
//
@@ -758,7 +758,7 @@ const (
758758
// This reason is used with the "ResolvedRefs" condition when
759759
// one of the Listener's Routes has a BackendRef to an object in
760760
// another namespace, where the object in the other namespace does
761-
// not have a ReferencePolicy explicitly allowing the reference.
761+
// not have a ReferenceGrant explicitly allowing the reference.
762762
ListenerReasonRefNotPermitted ListenerConditionReason = "RefNotPermitted"
763763
)
764764

apis/v1alpha2/httproute_types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ type HTTPRouteRule struct {
204204
// * an unknown or unsupported kind of resource
205205
// * a resource that does not exist
206206
// * a resource in another namespace when the reference has not been
207-
// explicitly allowed by a ReferencePolicy (or equivalent concept).
207+
// explicitly allowed by a ReferenceGrant (or equivalent concept).
208208
//
209209
// When a BackendRef is invalid, 404 status codes MUST be returned for
210210
// requests that would have otherwise been routed to an invalid backend. If
@@ -833,7 +833,7 @@ type HTTPRequestMirrorFilter struct {
833833
// this backend in the underlying implementation.
834834
//
835835
// If there is a cross-namespace reference to an *existing* object
836-
// that is not allowed by a ReferencePolicy, the controller must ensure the
836+
// that is not allowed by a ReferenceGrant, the controller must ensure the
837837
// "ResolvedRefs" condition on the Route is set to `status: False`,
838838
// with the "RefNotPermitted" reason and not configure this backend in the
839839
// underlying implementation.
@@ -856,7 +856,7 @@ type HTTPBackendRef struct {
856856
// configure this backend in the underlying implementation.
857857
//
858858
// If there is a cross-namespace reference to an *existing* object
859-
// that is not covered by a ReferencePolicy, the controller must ensure the
859+
// that is not covered by a ReferenceGrant, the controller must ensure the
860860
// "ResolvedRefs" condition on the Route is set to `status: False`,
861861
// with the "RefNotPermitted" reason and not configure this backend in the
862862
// underlying implementation.

apis/v1alpha2/object_reference_types.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ type SecretObjectReference struct {
6565
// Namespace is the namespace of the backend. When unspecified, the local
6666
// namespace is inferred.
6767
//
68-
// Note that when a namespace is specified, a ReferencePolicy object
68+
// Note that when a namespace is specified, a ReferenceGrant object
6969
// is required in the referent namespace to allow that namespace's
70-
// owner to accept the reference. See the ReferencePolicy documentation
70+
// owner to accept the reference. See the ReferenceGrant documentation
7171
// for details.
7272
//
7373
// Support: Core
@@ -80,9 +80,9 @@ type SecretObjectReference struct {
8080
// specific to BackendRef. It includes a few additional fields and features
8181
// than a regular ObjectReference.
8282
//
83-
// Note that when a namespace is specified, a ReferencePolicy object
83+
// Note that when a namespace is specified, a ReferenceGrant object
8484
// is required in the referent namespace to allow that namespace's
85-
// owner to accept the reference. See the ReferencePolicy documentation
85+
// owner to accept the reference. See the ReferenceGrant documentation
8686
// for details.
8787
//
8888
// The API object must be valid in the cluster; the Group and Kind must
@@ -112,9 +112,9 @@ type BackendObjectReference struct {
112112
// Namespace is the namespace of the backend. When unspecified, the local
113113
// namespace is inferred.
114114
//
115-
// Note that when a namespace is specified, a ReferencePolicy object
115+
// Note that when a namespace is specified, a ReferenceGrant object
116116
// is required in the referent namespace to allow that namespace's
117-
// owner to accept the reference. See the ReferencePolicy documentation
117+
// owner to accept the reference. See the ReferenceGrant documentation
118118
// for details.
119119
//
120120
// Support: Core

apis/v1alpha2/referencepolicy_types.go

+17-17
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,42 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
// +kubebuilder:storageversion
2525
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
2626

27-
// ReferencePolicy identifies kinds of resources in other namespaces that are
27+
// ReferenceGrant identifies kinds of resources in other namespaces that are
2828
// trusted to reference the specified kinds of resources in the same namespace
2929
// as the policy.
3030
//
31-
// Each ReferencePolicy can be used to represent a unique trust relationship.
31+
// Each ReferenceGrant can be used to represent a unique trust relationship.
3232
// Additional Reference Policies can be used to add to the set of trusted
3333
// sources of inbound references for the namespace they are defined within.
3434
//
3535
// All cross-namespace references in Gateway API (with the exception of cross-namespace
36-
// Gateway-route attachment) require a ReferencePolicy.
36+
// Gateway-route attachment) require a ReferenceGrant.
3737
//
3838
// Support: Core
3939
//
40-
type ReferencePolicy struct {
40+
type ReferenceGrant struct {
4141
metav1.TypeMeta `json:",inline"`
4242
metav1.ObjectMeta `json:"metadata,omitempty"`
4343

44-
// Spec defines the desired state of ReferencePolicy.
45-
Spec ReferencePolicySpec `json:"spec,omitempty"`
44+
// Spec defines the desired state of ReferenceGrant.
45+
Spec ReferenceGrantSpec `json:"spec,omitempty"`
4646

4747
// Note that `Status` sub-resource has been excluded at the
4848
// moment as it was difficult to work out the design.
4949
// `Status` sub-resource may be added in future.
5050
}
5151

5252
// +kubebuilder:object:root=true
53-
// ReferencePolicyList contains a list of ReferencePolicy.
54-
type ReferencePolicyList struct {
53+
// ReferenceGrantList contains a list of ReferenceGrant.
54+
type ReferenceGrantList struct {
5555
metav1.TypeMeta `json:",inline"`
5656
metav1.ListMeta `json:"metadata,omitempty"`
57-
Items []ReferencePolicy `json:"items"`
57+
Items []ReferenceGrant `json:"items"`
5858
}
5959

60-
// ReferencePolicySpec identifies a cross namespace relationship that is trusted
60+
// ReferenceGrantSpec identifies a cross namespace relationship that is trusted
6161
// for Gateway API.
62-
type ReferencePolicySpec struct {
62+
type ReferenceGrantSpec struct {
6363
// From describes the trusted namespaces and kinds that can reference the
6464
// resources described in "To". Each entry in this list must be considered
6565
// to be an additional place that references can be valid from, or to put
@@ -69,7 +69,7 @@ type ReferencePolicySpec struct {
6969
//
7070
// +kubebuilder:validation:MinItems=1
7171
// +kubebuilder:validation:MaxItems=16
72-
From []ReferencePolicyFrom `json:"from"`
72+
From []ReferenceGrantFrom `json:"from"`
7373

7474
// To describes the resources that may be referenced by the resources
7575
// described in "From". Each entry in this list must be considered to be an
@@ -80,11 +80,11 @@ type ReferencePolicySpec struct {
8080
//
8181
// +kubebuilder:validation:MinItems=1
8282
// +kubebuilder:validation:MaxItems=16
83-
To []ReferencePolicyTo `json:"to"`
83+
To []ReferenceGrantTo `json:"to"`
8484
}
8585

86-
// ReferencePolicyFrom describes trusted namespaces and kinds.
87-
type ReferencePolicyFrom struct {
86+
// ReferenceGrantFrom describes trusted namespaces and kinds.
87+
type ReferenceGrantFrom struct {
8888
// Group is the group of the referent.
8989
// When empty, the Kubernetes core API group is inferred.
9090
//
@@ -107,9 +107,9 @@ type ReferencePolicyFrom struct {
107107
Namespace Namespace `json:"namespace"`
108108
}
109109

110-
// ReferencePolicyTo describes what Kinds are allowed as targets of the
110+
// ReferenceGrantTo describes what Kinds are allowed as targets of the
111111
// references.
112-
type ReferencePolicyTo struct {
112+
type ReferenceGrantTo struct {
113113
// Group is the group of the referent.
114114
// When empty, the Kubernetes core API group is inferred.
115115
//

apis/v1alpha2/shared_types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ type PortNumber int32
150150
// BackendRef defines how a Route should forward a request to a Kubernetes
151151
// resource.
152152
//
153-
// Note that when a namespace is specified, a ReferencePolicy object
153+
// Note that when a namespace is specified, a ReferenceGrant object
154154
// is required in the referent namespace to allow that namespace's
155-
// owner to accept the reference. See the ReferencePolicy documentation
155+
// owner to accept the reference. See the ReferenceGrant documentation
156156
// for details.
157157
type BackendRef struct {
158158
// BackendObjectReference references a Kubernetes object.
@@ -239,7 +239,7 @@ const (
239239
// This reason is used with the "ResolvedRefs" condition when
240240
// one of the Listener's Routes has a BackendRef to an object in
241241
// another namespace, where the object in the other namespace does
242-
// not have a ReferencePolicy explicitly allowing the reference.
242+
// not have a ReferenceGrant explicitly allowing the reference.
243243
RouteReasonRefNotPermitted RouteConditionReason = "RefNotPermitted"
244244
)
245245

apis/v1alpha2/zz_generated.deepcopy.go

+25-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha2/zz_generated.register.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/experimental/gateway.networking.k8s.io_gateways.yaml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)