rback
rback copied to clipboard
Show directly related ClusterRoles&Bindings when resource not specified
Using the example RBAC resources from examples/create-example-rbac-rules.sh, as you would expect, if you run
kubectl rback -n namespace1 sa
rback shows three additional (Cluster)RoleBindings that aren't in namespace1, but reference ServiceAccounts in that namespace.
But if you run
kubectl rback -n namespace1
those three additional (Cluster)RoleBindings aren't shown. IMHO, they should be, since they are all directly related to some resources in namespace1. When you don't specify a resource kind, but do specify a namespace, rback should show all RBAC resources from namespace1 plus all directly related resources (from any other namespace or cluster-scope).
It should show:
- all (Cluster)RoleBindings that reference any ServiceAccount from the namespace
- all subjects that are referenced by RoleBindings in the namespace (*rback already does this)
- all ClusterRoles that are referenced by RoleBindings in the namespace (*rback already does this)