# helm_charts_artifactory-rolebinding.yaml
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    app: {{ template "artifactory.name" . }}
    chart: {{ template "artifactory.chart" . }}
    component: {{ .Values.artifactory.name }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "artifactory.fullname" . }}
subjects:
- kind: ServiceAccount
  name: {{ template "artifactory.serviceAccountName" . }}
roleRef:
  kind: Role
  apiGroup: rbac.authorization.k8s.io
  name: {{ template "artifactory.fullname" . }}
{{- end }}