Skip to content

Conversation

@pcallewaert
Copy link
Contributor

Hi 👋

Since using the dropOnDelete flag for the Postgres object, it occurred that the operator was in a crash loop. It was always crashing on the Reconcile loop for PostgresUser because the database was already dropped.
It happens when our ArgoCD deployment deletes the application, and eventually the Postgres object is first removed before the PostgresUser.

I did a small refactor of GetConnection to be able to get the pq error code out of it, and in DropRole I check if the error is the error code for database does not exists.

Not sure if this is the best solution, but I've deployed this fix this week and so far it did not trigger the crash loop anymore.

@hitman99 hitman99 merged commit a4e44c7 into movetokube:master Dec 22, 2021
@hitman99
Copy link
Member

Hi @pcallewaert thank you for your contribution! Sorry for such a delay getting this merged - I have very limited time maintaining this project this year.

@pcallewaert pcallewaert deleted the pc/handle-dropped-db-postgresuser branch February 1, 2022 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants