Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow builtin 'admin' role to manage HNC objects
The builtin 'admin' clusterrole doesn't include custom resources by default. This change allows 'admin' to modify any HNC resource. If granted at the cluster level, it will allow the user to administer HNC itself (via the HNCConfiguration object); otherwise, it will allow a user to administer the HierarchyConfiguration singleton in the namespace (and its descendants) as well as SubnamespaceAnchors. Note that this will *not* allow that user to change the _parent_ of that namespace without permissions in the root of its tree (see user guide for more details). Tested: before this change, I gave the 'admin' role to the default service account in 'foo' and ran the following command: ``` k hns create bar -n foo --as system:serviceaccount:foo:default ``` Result: ``` Could not create subnamespace anchor. Reason: subnamespaceanchors.hnc.x-k8s.io "bar" is forbidden: User "system:serviceaccount:foo:default" cannot create resource "subnamespaceanchors" in API group "hnc.x-k8s.io" in the namespace "foo" ``` After this change, the same command passes.
- Loading branch information