-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Support users with partial list access to the cluster
In order to find all dependents of a given object, we need to list every single object in the cluster & look up its `metadata.ownerReferences` field. Doing this requires the user to have cluster scope access to list all resources. If the given object is a namespaced resource, we would only need full access to list all resource in the namespace of the given object because Kubernetes doesn't allow cross-namespace ownership & hence the dependents for such object has to reside in the same namespace. It's pretty trivial to find out which resources a user has list access (via the SelfSubjectRulesReview API) but if a user cannot list a resource across all namespaces, the task becomes much more complicated if we want to find out which namespaces the user has list access for that resource. To keep things simple for now, we will optimize our solution mainly for two groups of user: 1. Users that can list all resources across all namespaces. Usually these are cluster admins or platform engineers who are interested in finding dependents of both cluster-scoped & namespaced objects. 2. Users that can only list resources within a single namespace. Usually these are engineers who are given access to a namespace to deploy their app/service & they're only interested in finding dependents of namespaced objects. Signed-off-by: Justin Toh <tohjustin@hotmail.com>
- Loading branch information
Showing
2 changed files
with
56 additions
and
31 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
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