Skip to content

Commit 5f301dc

Browse files
authored
Merge pull request #29468 from Abirdcfly/patch-2
Update rbac.md: Describe in detail how to specify resourceNames when using list verbs
2 parents 294f591 + 19807f8 commit 5f301dc

File tree

1 file changed

+4
-2
lines changed
  • content/en/docs/reference/access-authn-authz

1 file changed

+4
-2
lines changed

content/en/docs/reference/access-authn-authz/rbac.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,10 @@ rules:
279279
```
280280

281281
{{< note >}}
282-
You cannot restrict `create` or `deletecollection` requests by resourceName. For `create`, this
283-
limitation is because the object name is not known at authorization time.
282+
You cannot restrict `create` or `deletecollection` requests by their resource name.
283+
For `create`, this limitation is because the name of the new object may not be known at authorization time.
284+
If you restrict `list` or `watch` by resourceName, clients must include a `metadata.name` field selector in their `list` or `watch` request that matches the specified resourceName in order to be authorized.
285+
For example, `kubectl get configmaps --field-selector=metadata.name=my-configmap`
284286
{{< /note >}}
285287

286288

0 commit comments

Comments
 (0)