{{- if (.Values.global.rbac) -}}
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: drycc-builder
  labels:
    app: drycc-builder
    heritage: drycc
rules:
- apiGroups: [""]
  resources: ["secrets"]
  verbs: ["create", "update", "delete"]
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["create", "get", "watch", "list"]
- apiGroups: [""]
  resources: ["pods/log"]
  verbs: ["get"]
- apiGroups: ["batch"]
  resources: ["jobs"]
  verbs: ["create"]
{{- end -}}
