Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Add VolumeSnapshot related RBACs to provider service account for TKC/GC
Browse files Browse the repository at this point in the history
  • Loading branch information
akankshapanse committed Mar 17, 2023
1 parent 20d147c commit 3ae2943
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions addons/controllers/csi/vspherecsiconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ var providerServiceAccountRBACRules = []rbacv1.PolicyRule{
Resources: []string{"events"},
Verbs: []string{"list"},
},
{
APIGroups: []string{""},
Resources: []string{"volumesnapshots"},
Verbs: []string{"create", "delete", "get", "list", "patch"},
},
}

// VsphereCSIProviderServiceAccountAggregatedClusterRole is the cluster role to assign permissions to capv provider
Expand Down
2 changes: 1 addition & 1 deletion addons/controllers/vspherecsiconfig_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ var _ = Describe("VSphereCSIConfig Reconciler", func() {
}
Expect(serviceAccount.Spec.Ref.Name).To(Equal(vsphereClusterName))
Expect(serviceAccount.Spec.Ref.Namespace).To(Equal(configKey.Namespace))
Expect(serviceAccount.Spec.Rules).To(HaveLen(6))
Expect(serviceAccount.Spec.Rules).To(HaveLen(7))
Expect(serviceAccount.Spec.TargetNamespace).To(Equal("vmware-system-csi"))
Expect(serviceAccount.Spec.TargetSecretName).To(Equal("pvcsi-provider-creds"))
return nil
Expand Down

0 comments on commit 3ae2943

Please # to comment.