Skip to content

Commit 4369d3e

Browse files
committed
remove the check of exisiting database before deleteing the postgresuser
1 parent 68bdf9d commit 4369d3e

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

pkg/controller/postgresuser/postgresuser_controller.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,6 @@ func (r *ReconcilePostgresUser) Reconcile(request reconcile.Request) (reconcile.
130130
// Initialize database name for connection with default database
131131
// in case postgres cr isn't here anymore
132132
db := r.pg.GetDefaultDatabase()
133-
// Search Postgres CR
134-
postgres, err := r.getPostgresCR(instance)
135-
// Check if error exists and not a not found error
136-
if err != nil && !errors.IsNotFound(err) {
137-
return reconcile.Result{}, err
138-
}
139-
// Check if postgres cr is found and not in deletion state
140-
if postgres != nil && !postgres.GetDeletionTimestamp().IsZero() {
141-
db = instance.Status.DatabaseName
142-
}
143133
err = r.pg.DropRole(instance.Status.PostgresRole, instance.Status.PostgresGroup,
144134
db, reqLogger)
145135
if err != nil {

0 commit comments

Comments
 (0)