apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: dataflow-manager
rules:
  # read-only permissions by default, pipelines are owned by users and the controller has no place to be changing them
  - apiGroups:
      - dataflow.argoproj.io
    resources:
      - pipelines
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - dataflow.argoproj.io
    resources:
      - steps
    verbs:
      - create
      - delete
      - get
      - list
      - update
      - watch
  - apiGroups:
      - dataflow.argoproj.io
    resources:
      - pipelines/status
    verbs:
      - update
  - apiGroups:
      - dataflow.argoproj.io
    resources:
      - steps/status
    verbs:
      - update
  - apiGroups:
      - dataflow.argoproj.io
    resources:
      - steps/scale
    verbs:
      - patch
  - apiGroups:
      - ""
    resources:
      - pods
      - pods/exec
    verbs:
      - create
      - get
      - list
      - watch
      - delete
  - apiGroups:
      - ""
    resources:
      - services
    verbs:
      - create
      - get
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - create
      - patch