From fd62c3a9b3dad4dd1bc2a4ffceeb7278facf7b08 Mon Sep 17 00:00:00 2001 From: "romg@pecan.ai" Date: Thu, 1 Jun 2023 14:52:27 +0200 Subject: [PATCH] remove the check of exisiting database before deleteing the postgresuser --- pkg/controller/postgresuser/postgresuser_controller.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkg/controller/postgresuser/postgresuser_controller.go b/pkg/controller/postgresuser/postgresuser_controller.go index 5925f2a6..8ffda4c1 100644 --- a/pkg/controller/postgresuser/postgresuser_controller.go +++ b/pkg/controller/postgresuser/postgresuser_controller.go @@ -130,16 +130,6 @@ func (r *ReconcilePostgresUser) Reconcile(request reconcile.Request) (reconcile. // Initialize database name for connection with default database // in case postgres cr isn't here anymore db := r.pg.GetDefaultDatabase() - // Search Postgres CR - postgres, err := r.getPostgresCR(instance) - // Check if error exists and not a not found error - if err != nil && !errors.IsNotFound(err) { - return reconcile.Result{}, err - } - // Check if postgres cr is found and not in deletion state - if postgres != nil && !postgres.GetDeletionTimestamp().IsZero() { - db = instance.Status.DatabaseName - } err = r.pg.DropRole(instance.Status.PostgresRole, instance.Status.PostgresGroup, db, reqLogger) if err != nil {