mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-08-18 20:17:04 +00:00
Remove unnecessary pods delete permission from ClusterRole
The descheduler ClusterRole granted both pods:delete and pods/eviction:create. Eviction goes through the eviction subresource (PolicyV1().Evictions().Evict, requiring pods/eviction:create), and there are no direct pod Delete calls anywhere in the codebase, so the pods:delete verb is unused. Drop it to follow least privilege. Signed-off-by: Aman Raj <aman.yug@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ rules:
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "watch", "list", "delete"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods/eviction"]
|
||||
verbs: ["create"]
|
||||
|
||||
@@ -15,7 +15,7 @@ rules:
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "watch", "list", "delete"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods/eviction"]
|
||||
verbs: ["create"]
|
||||
|
||||
Reference in New Issue
Block a user