Skip to content

Commit

Permalink
Update pgAdmin RBAC to match feature requirements
Browse files Browse the repository at this point in the history
Adjust kubebuilder markers and regenerate RBAC for current
pgAdmin feature.

PGO-565
  • Loading branch information
tjmoore4 committed Oct 16, 2023
1 parent b05eb54 commit 400c101
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 58 deletions.
28 changes: 1 addition & 27 deletions config/rbac/cluster/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,10 @@ rules:
- postgres-operator.crunchydata.com
resources:
- pgadmins
- pgupgrades
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- postgres-operator.crunchydata.com
Expand All @@ -123,29 +120,6 @@ rules:
- postgres-operator.crunchydata.com
resources:
- pgadmins/status
verbs:
- get
- patch
- update
- watch
- apiGroups:
- postgres-operator.crunchydata.com
resources:
- pgpgadmins
verbs:
- list
- watch
- apiGroups:
- postgres-operator.crunchydata.com
resources:
- pgupgrades
verbs:
- get
- list
- watch
- apiGroups:
- postgres-operator.crunchydata.com
resources:
- pgupgrades/status
- postgresclusters/status
verbs:
Expand Down
28 changes: 1 addition & 27 deletions config/rbac/namespace/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,10 @@ rules:
- postgres-operator.crunchydata.com
resources:
- pgadmins
- pgupgrades
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- postgres-operator.crunchydata.com
Expand All @@ -123,29 +120,6 @@ rules:
- postgres-operator.crunchydata.com
resources:
- pgadmins/status
verbs:
- get
- patch
- update
- watch
- apiGroups:
- postgres-operator.crunchydata.com
resources:
- pgpgadmins
verbs:
- list
- watch
- apiGroups:
- postgres-operator.crunchydata.com
resources:
- pgupgrades
verbs:
- get
- list
- watch
- apiGroups:
- postgres-operator.crunchydata.com
resources:
- pgupgrades/status
- postgresclusters/status
verbs:
Expand Down
5 changes: 2 additions & 3 deletions internal/controller/standalone_pgadmin/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ func (r *PGAdminReconciler) watchPostgresClusters() handler.Funcs {
}
}

//+kubebuilder:rbac:groups=postgres-operator.crunchydata.com,resources=pgadmins,verbs={get,list,watch,create,update,patch,delete}
//+kubebuilder:rbac:groups=postgres-operator.crunchydata.com,resources=pgadmins/status,verbs={get,update,patch}
//+kubebuilder:rbac:groups=postgres-operator.crunchydata.com,resources=pgadmins/finalizers,verbs={update}
//+kubebuilder:rbac:groups="postgres-operator.crunchydata.com",resources="pgadmins",verbs={get}
//+kubebuilder:rbac:groups="postgres-operator.crunchydata.com",resources="pgadmins/status",verbs={patch}

// Reconcile which aims to move the current state of the pgAdmin closer to the
// desired state described in a [v1beta1.PGAdmin] identified by request.
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/standalone_pgadmin/postgrescluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

//+kubebuilder:rbac:groups="postgres-operator.crunchydata.com",resources="pgpgadmins",verbs={list}
//+kubebuilder:rbac:groups="postgres-operator.crunchydata.com",resources="pgadmins",verbs={list}

// findPGAdminsForPostgresCluster returns PGAdmins that target a given cluster.
func (r *PGAdminReconciler) findPGAdminsForPostgresCluster(
Expand Down

0 comments on commit 400c101

Please sign in to comment.