Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "STOR-1065: Rework sidecar bindings to bind common ClusterRoles" #118

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,12 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-csi-main-attacher-binding
name: openstack-cinder-csi-attacher-binding
subjects:
- kind: ServiceAccount
name: openstack-cinder-csi-driver-controller-sa
namespace: openshift-cluster-csi-drivers
roleRef:
kind: ClusterRole
name: openshift-csi-main-attacher-role
name: openstack-cinder-external-attacher-role
apiGroup: rbac.authorization.k8s.io
20 changes: 20 additions & 0 deletions assets/rbac/attacher_role.yaml
@@ -0,0 +1,20 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-external-attacher-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments/status"]
verbs: ["patch"]
10 changes: 0 additions & 10 deletions assets/rbac/lease_leader_election_role.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions assets/rbac/lease_leader_election_rolebinding.yaml

This file was deleted.

@@ -1,12 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-csi-main-snapshotter-binding
name: openstack-cinder-csi-provisioner-binding
subjects:
- kind: ServiceAccount
name: openstack-cinder-csi-driver-controller-sa
namespace: openshift-cluster-csi-drivers
roleRef:
kind: ClusterRole
name: openshift-csi-main-snapshotter-role
name: openstack-cinder-external-provisioner-role
apiGroup: rbac.authorization.k8s.io
29 changes: 29 additions & 0 deletions assets/rbac/provisioner_role.yaml
@@ -0,0 +1,29 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-external-provisioner-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["get", "list"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
@@ -1,12 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-main-resizer-binding
name: openstack-cinder-csi-resizer-binding
subjects:
- kind: ServiceAccount
name: openstack-cinder-csi-driver-controller-sa
namespace: openshift-cluster-csi-drivers
roleRef:
kind: ClusterRole
name: openshift-csi-main-resizer-role
name: openstack-cinder-external-resizer-role
apiGroup: rbac.authorization.k8s.io
23 changes: 23 additions & 0 deletions assets/rbac/resizer_role.yaml
@@ -0,0 +1,23 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-external-resizer-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims/status"]
verbs: ["update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
@@ -1,12 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-csi-main-provisioner-binding
name: openstack-cinder-csi-snapshotter-binding
subjects:
- kind: ServiceAccount
name: openstack-cinder-csi-driver-controller-sa
namespace: openshift-cluster-csi-drivers
roleRef:
kind: ClusterRole
name: openshift-csi-main-provisioner-role
name: openstack-cinder-external-snapshotter-role
apiGroup: rbac.authorization.k8s.io
38 changes: 38 additions & 0 deletions assets/rbac/snapshotter_role.yaml
@@ -0,0 +1,38 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: openstack-cinder-external-snapshotter-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create", "list", "watch", "delete"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
12 changes: 0 additions & 12 deletions assets/rbac/storageclass_reader_resizer_binding.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions assets/rbac/volumesnapshot_reader_provisioner_binding.yaml

This file was deleted.

16 changes: 8 additions & 8 deletions pkg/operator/starter.go
Expand Up @@ -94,21 +94,21 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
"node_sa.yaml",
"service.yaml",
"cabundle_cm.yaml",
"rbac/main_attacher_binding.yaml",
"rbac/attacher_role.yaml",
"rbac/attacher_binding.yaml",
"rbac/privileged_role.yaml",
"rbac/controller_privileged_binding.yaml",
"rbac/node_privileged_binding.yaml",
"rbac/main_provisioner_binding.yaml",
"rbac/volumesnapshot_reader_provisioner_binding.yaml",
"rbac/main_resizer_binding.yaml",
"rbac/storageclass_reader_resizer_binding.yaml",
"rbac/main_snapshotter_binding.yaml",
"rbac/provisioner_role.yaml",
"rbac/provisioner_binding.yaml",
"rbac/resizer_role.yaml",
"rbac/resizer_binding.yaml",
"rbac/snapshotter_role.yaml",
"rbac/snapshotter_binding.yaml",
"rbac/kube_rbac_proxy_role.yaml",
"rbac/kube_rbac_proxy_binding.yaml",
"rbac/prometheus_role.yaml",
"rbac/prometheus_rolebinding.yaml",
"rbac/lease_leader_election_role.yaml",
"rbac/lease_leader_election_rolebinding.yaml",
},
).WithConditionalStaticResourcesController(
"OpenStackCinderDriverConditionalStaticResourcesController",
Expand Down