{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ include "flink-cdc-job.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "flink-cdc-job.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ include "flink-cdc-job.fullname" . }}
subjects:
  - kind: ServiceAccount
    name: {{ include "flink-cdc-job.serviceAccountName" . }}
    namespace: {{ .Release.Namespace }}
{{- end }}
