{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: {{ .Release.Name }}-aggregate-to-patching
  labels:
    "redskyops.dev/aggregate-to-patching": "true"
rules:
  - apiGroups:
      - ""
    resources:
      - configmaps
    verbs:
      - patch
      - get
  - apiGroups:
      - apps
      - extensions
    resources:
      - deployments
      - statefulsets
    verbs:
      - patch
      - get
{{- end -}}
