This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new PreHook called checkPostPassword that will check the Helm Release to see if
upstream.postgresql.auth.password
andupstream.postgresql.auth.postgresPassword
has been set. The purpose of this is to fix the problem of reconcile error stating thatupstream.postgresql.auth.password
andupstream.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