apiVersion: v1
kind: ServiceAccount
metadata:
  name: tekton-triggers-sa-{{ .Release.Namespace }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "edp-tekton.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: tekton-triggers-eventlistener-binding-{{ .Release.Namespace }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "edp-tekton.labels" . | nindent 4 }}
subjects:
  - kind: ServiceAccount
    name: tekton-triggers-sa-{{ .Release.Namespace }}
    namespace: {{ .Release.Namespace }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: tekton-triggers-eventlistener-roles
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tekton-triggers-eventlistener-clusterbinding-{{ .Release.Namespace }}
  labels:
    {{- include "edp-tekton.labels" . | nindent 4 }}
subjects:
  - kind: ServiceAccount
    name: tekton-triggers-sa-{{ .Release.Namespace }}
    namespace: {{ .Release.Namespace }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: tekton-triggers-eventlistener-clusterroles
