Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove the check of exisiting database before deleteing the postgresuser #119

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/ext-postgres-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.2.3
version: 1.2.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.2.3"
appVersion: "1.2.4"
10 changes: 0 additions & 10 deletions pkg/controller/postgresuser/postgresuser_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down