Closed PatAKnight closed 10 months ago
SonarCloud Quality Gate failed.
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
16.9% Duplication
Catch issues before they fail your Quality Gate with our IDE extension SonarLint
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