@@ -49,49 +49,121 @@ spec:
4949
5050 target references.
5151 items :
52- description : |-
53- LocalPolicyTargetReferenceWithSectionName identifies an API object to apply a
54- direct policy to. This should be used as part of Policy resources that can
55- target single resources. For more information on how this policy attachment
56- mode works, and a sample Policy resource, refer to the policy attachment
57- documentation for Gateway API.
58-
59-
60- Note: This should only be used for direct policy attachment when references
61- to SectionName are actually needed. In all other cases,
62- LocalPolicyTargetReference should be used.
6352 properties :
6453 group :
65- description : Group is the group of the target resource.
54+ description : |-
55+ Group refers to a Kubernetes Group. It must either be an empty string or a
56+ RFC 1123 subdomain.
57+
58+
59+ This validation is based off of the corresponding Kubernetes validation:
60+ https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208
61+
62+
63+ Valid values include:
64+
65+
66+ * "" - empty string implies core Kubernetes API group
67+ * "gateway.networking.k8s.io"
68+ * "foo.example.com"
69+
70+
71+ Invalid values include:
72+
73+
74+ * "example.com/bar" - "/" is an invalid character
6675 maxLength : 253
6776 pattern : ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
6877 type : string
6978 kind :
70- description : Kind is kind of the target resource.
79+ description : |-
80+ Kind refers to a Kubernetes Kind.
81+
82+
83+ Valid values include:
84+
85+
86+ * "Service"
87+ * "HTTPRoute"
88+
89+
90+ Invalid values include:
91+
92+
93+ * "invalid/kind" - "/" is an invalid character
7194 maxLength : 63
7295 minLength : 1
7396 pattern : ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
7497 type : string
7598 name :
76- description : Name is the name of the target resource.
99+ description : |-
100+ ObjectName refers to the name of a Kubernetes object.
101+ Object names can have a variety of forms, including RFC 1123 subdomains,
102+ RFC 1123 labels, or RFC 1035 labels.
77103 maxLength : 253
78104 minLength : 1
79105 type : string
106+ namespace :
107+ description : |-
108+ Namespace refers to a Kubernetes namespace. It must be a RFC 1123 label.
109+
110+
111+ This validation is based off of the corresponding Kubernetes validation:
112+ https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L187
113+
114+
115+ This is used for Namespace name validation here:
116+ https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/api/validation/generic.go#L63
117+
118+
119+ Valid values include:
120+
121+
122+ * "example"
123+
124+
125+ Invalid values include:
126+
127+
128+ * "example.com" - "." is an invalid character
129+ maxLength : 63
130+ minLength : 1
131+ pattern : ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
132+ type : string
80133 sectionName :
81134 description : |-
82- SectionName is the name of a section within the target resource. When
83- unspecified, this targetRef targets the entire resource. In the following
84- resources, SectionName is interpreted as the following:
135+ SectionName is the name of a section in a Kubernetes resource.
136+
137+
138+ In the following resources, SectionName is interpreted as the following:
85139
86140
87141 * Gateway: Listener name
88142 * HTTPRoute: HTTPRouteRule name
89143 * Service: Port name
90144
91145
92- If a SectionName is specified, but does not exist on the targeted object,
93- the Policy must fail to attach, and the policy implementation should record
94- a `ResolvedRefs` or similar Condition in the Policy's status.
146+ Section names can have a variety of forms, including RFC 1123 subdomains,
147+ RFC 1123 labels, or RFC 1035 labels.
148+
149+
150+ This validation is based off of the corresponding Kubernetes validation:
151+ https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208
152+
153+
154+ Valid values include:
155+
156+
157+ * "example"
158+ * "foo-example"
159+ * "example.com"
160+ * "foo.example.com"
161+
162+
163+ Invalid values include:
164+
165+
166+ * "example.com/bar" - "/" is an invalid character
95167 maxLength : 253
96168 minLength : 1
97169 pattern : ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
@@ -110,14 +182,8 @@ spec:
110182 - name
111183 x-kubernetes-list-type : map
112184 vars :
113- description : Vars represents the route match expressions of APISIX.
114185 items :
115- items :
116- description : |-
117- StringOrSlice represents a string or a string slice.
118- TODO Do not use interface{} to avoid the reflection overheads.
119- type : object
120- type : array
186+ x-kubernetes-preserve-unknown-fields : true
121187 type : array
122188 required :
123189 - targetRefs
0 commit comments