apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: habitat-operator-v1beta1
# Keep Cluster wide permissions at the top of the list and then update
# `TestRolesAndClusterRolesSync` in `test/sync/rbac` package to exclude
# those rules
rules:
- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
  resources:
  - namespaces
  verbs: ["list"]
- apiGroups:
  - habitat.sh
  resources:
  - habitats
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups:
  - apps
  resources:
  - statefulsets
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
  resources:
  - configmaps
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
  resources:
  - secrets
  verbs: ["get"]
- apiGroups: [""]
  resources:
  - pods
  verbs: ["get", "list", "watch", "deletecollection"]
- apiGroups: [""]
  resources:
  - events
  verbs: [ "create", "patch" ]
