Merge pull request #135418 from carlory/gang_scheduling_rbac

add Workload permissions to view, edit and admin clusterroles
This commit is contained in:
Kubernetes Prow Robot
2025-12-17 22:35:14 -08:00
committed by GitHub
2 changed files with 24 additions and 0 deletions

View File

@@ -146,6 +146,9 @@ func viewRules() []rbacv1.PolicyRule {
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) {
rules = append(rules, rbacv1helpers.NewRule(Read...).Groups(resourceGroup).Resources("resourceclaims", "resourceclaims/status", "resourceclaimtemplates").RuleOrDie())
}
if utilfeature.DefaultFeatureGate.Enabled(features.GenericWorkload) {
rules = append(rules, rbacv1helpers.NewRule(Read...).Groups(schedulingGroup).Resources("workloads").RuleOrDie())
}
return rules
}
@@ -187,6 +190,9 @@ func editRules() []rbacv1.PolicyRule {
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) {
rules = append(rules, rbacv1helpers.NewRule(Write...).Groups(resourceGroup).Resources("resourceclaims", "resourceclaimtemplates").RuleOrDie())
}
if utilfeature.DefaultFeatureGate.Enabled(features.GenericWorkload) {
rules = append(rules, rbacv1helpers.NewRule(Write...).Groups(schedulingGroup).Resources("workloads").RuleOrDie())
}
return rules
}

View File

@@ -260,6 +260,16 @@ items:
- deletecollection
- patch
- update
- apiGroups:
- scheduling.k8s.io
resources:
- workloads
verbs:
- create
- delete
- deletecollection
- patch
- update
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
@@ -414,6 +424,14 @@ items:
- get
- list
- watch
- apiGroups:
- scheduling.k8s.io
resources:
- workloads
verbs:
- get
- list
- watch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata: