Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

missing permission in role yaml #95

@oriyarde

Description

@oriyarde

Hi,

I tried to deploy the replication operator as a sidecar container inside our csi controller pod.

I have a cluster role binding with a service account ("ibm-block-csi-controller-sa") and with a cluster role for the replication operator.
I copied said cluster role rules from the role yaml rules, and the replication operator log started nicely:

I0711 19:40:07.169702 1 common.go:111] Probing CSI driver for readiness
2021-07-11T19:40:07.171Z INFO setup starting manager
2021-07-11T19:40:07.171Z INFO controller-runtime.manager.controller.volumereplication Starting EventSource {"reconciler group": "replication.storage.openshift.io", "reconciler kind": "VolumeReplication", "source": "kind source: /, Kind="}
2021-07-11T19:40:07.271Z INFO controller-runtime.manager.controller.volumereplication Starting Controller {"reconciler group": "replication.storage.openshift.io", "reconciler kind": "VolumeReplication"}
2021-07-11T19:40:07.272Z INFO controller-runtime.manager.controller.volumereplication Starting workers {"reconciler group": "replication.storage.openshift.io", "reconciler kind": "VolumeReplication", "worker count": 1}

but then entered an error loop:

E0711 19:40:07.276673 1 reflector.go:127] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:156: Failed to watch *v1alpha1.VolumeReplicationClass: failed to list *v1alpha1.VolumeReplicationClass: volumereplicationclasses.replication.storage.openshift.io is forbidden: User "system:serviceaccount:default:ibm-block-csi-controller-sa" cannot list resource "volumereplicationclasses" in API group "replication.storage.openshift.io" at the cluster scope
E0711 19:40:08.432053 1 reflector.go:127] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:156: Failed to watch *v1alpha1.VolumeReplicationClass: failed to list *v1alpha1.VolumeReplicationClass: volumereplicationclasses.replication.storage.openshift.io is forbidden: User "system:serviceaccount:default:ibm-block-csi-controller-sa" cannot list resource "volumereplicationclasses" in API group "replication.storage.openshift.io" at the cluster scope
...

after adding the following rule (copied from the volumereplicationclass viewer role yaml, which is "for end users"):

- apiGroups:
  - replication.storage.openshift.io
  resources:
  - volumereplicationclasses
  verbs:
  - get
  - list
  - watch

the error was gone.

so I think this rule is missing in the role yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions