{{- if .Values.enabled -}}
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  labels:
    {{- include "weave-scope.helm_std_labels" . | indent 4 }}
    component: agent
  name: {{ template "weave-scope-agent.serviceAccountName" . }} 
  annotations:
    {{- include "weave-scope.annotations" . | indent 4 }}
rules:
  - apiGroups:
      - '*'
    resources:
      - '*'
    verbs:
      - '*'
  - nonResourceURLs:
      - '*'
    verbs:
      - '*'
{{- end }}
{{- end -}}
