Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

add checkPostPassword PreHook #35

Closed
wants to merge 1 commit into from

Conversation

PatAKnight
Copy link
Member

Description

This PR adds a new PreHook called checkPostPassword that will check the Helm Release to see if upstream.postgresql.auth.password and upstream.postgresql.auth.postgresPassword has been set. The purpose of this is to fix the problem of reconcile error stating that upstream.postgresql.auth.password and upstream.postgresql.auth.postgresPassword must not be empty.

The checkPostPassword will randomly generate a string for the password and postgresPassword fields whenever the helm chart is installed. These will then be picked up by the PostgreSQL helm chart. If these fields already have input in them, this prehook will skip adding to the fields.

Currently, there is a limitation to this that we will need to document. Essentially, if a user decides to enter in an existingSecret, they will also need to enter in the password and postgresPassword for the operator to work. The reason is that the operator will perform a dry run periodically and before any upgrades. This will lead to the error that the password and postgresPassword must not be empty.

One other thing to note. I had to update both the upstream and backstage values whenever I am setting the password. For some reason there is an issue with using one or the other. Only setting upstream will lead to the password error and only setting backstage will make it so that I can not skip setting the fields.

Which issues(s) does this PR fix

@PatAKnight PatAKnight changed the title add checkoutPostPassword PreHook add checkPostPassword PreHook Oct 17, 2023
@tumido tumido requested a review from kadel October 24, 2023 13:15
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
16.9% 16.9% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@nickboldt nickboldt closed this Dec 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix operator reconcile loop - pass existing PostgreSQL credentals
2 participants