mirror of https://github.com/k3s-io/k3s
Add new RBAC rules for CSIDriver
Nodes need to watch CSIDrivers to know if they should send pod information in NodePublish.pull/8/head
parent
db94508ae7
commit
dc6be0cbf1
|
@ -159,7 +159,7 @@ func NodeRules() []rbacv1.PolicyRule {
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.CSIPersistentVolume) {
|
if utilfeature.DefaultFeatureGate.Enabled(features.CSIPersistentVolume) {
|
||||||
volAttachRule := rbacv1helpers.NewRule("get").Groups(storageGroup).Resources("volumeattachments").RuleOrDie()
|
volAttachRule := rbacv1helpers.NewRule("get").Groups(storageGroup).Resources("volumeattachments").RuleOrDie()
|
||||||
nodePolicyRules = append(nodePolicyRules, volAttachRule)
|
nodePolicyRules = append(nodePolicyRules, volAttachRule)
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.CSISkipAttach) {
|
if utilfeature.DefaultFeatureGate.Enabled(features.CSISkipAttach) || utilfeature.DefaultFeatureGate.Enabled(features.CSIPodInfo) {
|
||||||
csiDriverRule := rbacv1helpers.NewRule("get", "watch", "list").Groups("csi.storage.k8s.io").Resources("csidrivers").RuleOrDie()
|
csiDriverRule := rbacv1helpers.NewRule("get", "watch", "list").Groups("csi.storage.k8s.io").Resources("csidrivers").RuleOrDie()
|
||||||
nodePolicyRules = append(nodePolicyRules, csiDriverRule)
|
nodePolicyRules = append(nodePolicyRules, csiDriverRule)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue