kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: pipeline-maintainer
rules:
  - verbs:
      - patch
      - get
    apiGroups:
      - ''
    resources:
      - serviceaccounts
    resourceNames:
      - pipeline # TODO: figure out how to 'gitops' this.
  - verbs:
      - create # allows addition of credentials only.
      - delete
    apiGroups:
      - ''
    resources:
      - secrets
  - verbs:
      - '*' # needed till we figure out how to cleanup workspaces.
    apiGroups:
      - 'tekton.dev'
    resources:
      - 'pipelineruns'
  - apiGroups:
      - results.tekton.dev
    resources:
      - results
      - records
    verbs:
      - get
      - list
