Add policy for pv protection controller

pull/6/head
NickrenREN 2018-01-26 15:20:51 +08:00
parent 3fee293607
commit 4b6a3439a3
1 changed files with 9 additions and 0 deletions

View File

@ -334,6 +334,15 @@ func buildControllerRoles() ([]rbac.ClusterRole, []rbac.ClusterRoleBinding) {
},
})
}
if utilfeature.DefaultFeatureGate.Enabled(features.StorageProtection) {
addControllerRole(&controllerRoles, &controllerRoleBindings, rbac.ClusterRole{
ObjectMeta: metav1.ObjectMeta{Name: saRolePrefix + "pv-protection-controller"},
Rules: []rbac.PolicyRule{
rbac.NewRule("get", "list", "watch", "update").Groups(legacyGroup).Resources("persistentvolumes").RuleOrDie(),
eventsRule(),
},
})
}
return controllerRoles, controllerRoleBindings
}