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.
This PR goes back to always sync pooler components, since updates on services are now supported with #1799.
Error handling in
syncConnectionPooler
is wrong. The GET request to find the pooler service defines err for the if block, but the latterif !k8sutil.ResourceNotFound(err)
check is using the last state oferr
from the surrounding scope. In case the postgresql resource has annotations defined,err
likely has the value<nil>
from updating the pooler deployment. If not,err
would still beNotFound
from the deployment check, henceif !k8sutil.ResourceNotFound(err)
check works as expected.The PR fixes another minor issue: A standby cluster could not have a connection pooler enabled because the operator would try to install the pooler user an schema in the DB cluster, although they should already be present (if the source clusters uses the pooler, too). Now, pooler installation is skipped for standby clusters.