@@ -26,8 +26,9 @@ const (
26
26
ResourceAll = "*"
27
27
VerbAll = "*"
28
28
NonResourceAll = "*"
29
+ NameAll = "*"
29
30
30
- NameAll = "*"
31
+ NamespaceEvery = "*" // matches every particular namespace
31
32
)
32
33
33
34
// System preset priority level names
@@ -210,28 +211,53 @@ type ServiceAccountSubject struct {
210
211
Name string
211
212
}
212
213
213
- // ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target
214
- // resource. A ResourcePolicyRule matches a request if and only if: (a) at least one member
215
- // of verbs matches the request, (b) at least one member of apiGroups matches the request, and (c) at least one member
216
- // of resources matches the request.
214
+ // ResourcePolicyRule is a predicate that matches some resource
215
+ // requests, testing the request's verb and the target resource. A
216
+ // ResourcePolicyRule matches a resource request if and only if: (a)
217
+ // at least one member of verbs matches the request, (b) at least one
218
+ // member of apiGroups matches the request, (c) at least one member of
219
+ // resources matches the request, and (d) least one member of
220
+ // namespaces matches the request.
217
221
type ResourcePolicyRule struct {
218
222
// `verbs` is a list of matching verbs and may not be empty.
219
- // "*" matches all verbs. if it is present, it must be the only entry.
223
+ // "*" matches all verbs and, if present, must be the only entry.
220
224
// +listType=set
221
225
// Required.
222
226
Verbs []string
227
+
223
228
// `apiGroups` is a list of matching API groups and may not be empty.
224
- // "*" matches all api- groups. if it is present, it must be the only entry.
229
+ // "*" matches all API groups and, if present, must be the only entry.
225
230
// +listType=set
226
231
// Required.
227
232
APIGroups []string
228
- // `resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource.
229
- // For example, [ "services", "nodes/status" ].
230
- // This list may not be empty.
231
- // "*" matches all resources. if it is present, it must be the only entry .
232
- // +listType=set
233
+
234
+ // `resources` is a list of matching resources (i.e., lowercase
235
+ // and plural) with, if desired, subresource. For example, [
236
+ // "services", "nodes/status" ]. This list may not be empty .
237
+ // "*" matches all resources and, if present, must be the only entry.
233
238
// Required.
239
+ // +listType=set
234
240
Resources []string
241
+
242
+ // `clusterScope` indicates whether to match requests that do not
243
+ // specify a namespace (which happens either because the resource
244
+ // is not namespaced or the request targets all namespaces).
245
+ // If this field is omitted or false then the `namespaces` field
246
+ // must contain a non-empty list.
247
+ // +optional
248
+ ClusterScope bool
249
+
250
+ // `namespaces` is a list of target namespaces that restricts
251
+ // matches. A request that specifies a target namespace matches
252
+ // only if either (a) this list contains that target namespace or
253
+ // (b) this list contains "*". Note that "*" matches any
254
+ // specified namespace but does not match a request that _does
255
+ // not specify_ a namespace (see the `clusterScope` field for
256
+ // that).
257
+ // This list may be empty, but only if `clusterScope` is true.
258
+ // +optional
259
+ // +listType=set
260
+ Namespaces []string
235
261
}
236
262
237
263
// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the
0 commit comments