apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cert-manager-{{ .Values.resolverName }}
rules:
- apiGroups:
  - {{ .Values.apiGroupName }}
  resources:
  - {{ .Values.resolverName }}
  verbs:
  - "*" # TODO(giolekva): limit
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cert-manager-pcloud-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cert-manager-{{ .Values.resolverName }}
subjects:
- kind: ServiceAccount
  name: {{ .Values.certManager.name }}
  namespace: {{ .Values.certManager.namespace }}
