apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: flatcar-linux-update-operator
  namespace: reboot-coordinator
rules:
  # For ConfigMap leases.
  - apiGroups:
      - ""
    resources:
      - configmaps
    verbs:
      - create
  - apiGroups:
      - ""
    resources:
      - configmaps
    resourceNames:
      - flatcar-linux-update-operator-lock
    verbs:
      - get
      - update
  # For publishing lease events.
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - create
      - watch
  # For leases.
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    verbs:
      - create
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    resourceNames:
      - flatcar-linux-update-operator-lock
    verbs:
      - get
      - update
