diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index a5bdc1e1..3a2af673 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -4,6 +4,14 @@ kind: ClusterRole metadata: name: manager-role rules: +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create + - get + - update - apiGroups: - db.movetokube.com resources: @@ -56,11 +64,3 @@ rules: - get - patch - update -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - create - - get - - update \ No newline at end of file diff --git a/internal/controller/postgres_controller.go b/internal/controller/postgres_controller.go index cdeb5714..310f4e0b 100644 --- a/internal/controller/postgres_controller.go +++ b/internal/controller/postgres_controller.go @@ -65,6 +65,7 @@ func (r *PostgresReconciler) GetPrefixedDbName(dbname string) string { //+kubebuilder:rbac:groups=db.movetokube.com,resources=postgres,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=db.movetokube.com,resources=postgres/status,verbs=get;update;patch //+kubebuilder:rbac:groups=db.movetokube.com,resources=postgres/finalizers,verbs=update +//+kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=create;get;update // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state.