Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clusterpool: ensure clusterdeployments namespace has same rbac as clu…
…ster-pool-admin Any role bindings in the namespace of the clusterpool that refer the ClusterRole `hive-cluster-pool-admin` will be used to provide the subjects the same permission in the namespaces created for various clusterdeployments for the clusterpool. The controller performs these additional actions for each reconcile, - lists all the rolebindings in clusterpool's namespace that refer the ClusterRole `hive-cluster-pool-admin` to collect all the subjects. This makes sure that no work needs to be done when there are such rolebindings. And since k8s ensures that a rolebinding cannot be created when the ref doesn't exist, this will ensure that only when the ClusterRole exists would the controller run the next steps. - lists all the namespaces attached to the clusterpool by using the constants.ClusterPoolNameLabel label selector. - creates/updates a rolebinding `hive-cluster-pool-admin-binding` in each namespace binding to the same ClusterRole. The controller also adds new watchers, - changes to rolebindings in the clusterdeployment namespace - changes to any rolebindings with ref to ClusterRole `hive-cluster-pool-admin` triggers resync for all clusterpools in that namespace.
- Loading branch information
1 parent
cb41795
commit 431d823
Showing
2 changed files
with
929 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.