# Apply only when running on OpenShift to let the kublet plugin run privileged
{{- if .Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints" -}}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ include "nvidia-dra-driver-gpu.name" . }}-openshift-privileged-role-binding
  namespace: {{ include "nvidia-dra-driver-gpu.namespace" . }}
subjects:
- kind: ServiceAccount
  name: {{ include "nvidia-dra-driver-gpu.serviceAccountName" . }}
  namespace: {{ include "nvidia-dra-driver-gpu.namespace" . }}
roleRef:
  kind: ClusterRole
  name: system:openshift:scc:privileged
  apiGroup: rbac.authorization.k8s.io
{{- end }}
