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.
fix #1060 Trigger running lookup function when new database are specified
fix 2: Try to delete the pooler secret only if master and/or replica pooler have been enabled in oldSpec but are both disabled in new spec.
fix 3: Do not sync the pooler when there's no change. This big condition to check if sync is needed did not work properly because we have initialized the connection pooler in several places to an empty struct (acidv1.ConnectionPooler{}) although being absent in the manifest. On sync it is compared to the newSpec where it's
nil
. It only worked when there was an update and we got the oldSpec from K8s, where it was alsonil
.Solution: If
nil
create an empty struct to be used with e.g. generating environment variables. Do not set cluster.Spec.ConnectionPooler = &acidv1.ConnectionPooler{}fix 3b: Do not sync when there's no pooler at all. The condition mentioned above did not check the case when there is no connection pooler running or has been disabled an not needed in newSpec.