apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    cdi.kubevirt.io/testing: ""
  name: cdi-testing-sa
  namespace: {{ .Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    cdi.kubevirt.io/testing: ""
  namespace: {{ .Namespace }}
  name: cdi-testing-role
rules:
- apiGroups: [""]
  resources: ["configmaps"]
  resourceNames: ["cdi-file-host-certs", "cdi-docker-registry-host-certs", "imageio-certs", "cdi-test-proxy-certs"]
  verbs: ["get", "update"]
- apiGroups: [""]
  resources: ["configmaps"]
  verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    cdi.kubevirt.io/testing: ""
  name: cdi-testing-rolebinding
  namespace: {{ .Namespace }}
subjects:
- kind: ServiceAccount
  name: cdi-testing-sa
roleRef:
  kind: Role
  name: cdi-testing-role
  apiGroup: rbac.authorization.k8s.io
