# grafana_charts_role-tokengen.yaml
{{ if .Values.tokengen.enable }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: {{ template "enterprise-logs.tokengenFullname" . }}
  labels:
    {{- include "enterprise-logs.tokengenLabels" . | nindent 4 }}
    {{- with .Values.tokengen.labels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  annotations:
    {{- with .Values.tokengen.annotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
    "helm.sh/hook": post-install
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["create"]
{{- end }}