Skip to content

fix: publish the load balancer address when PgBouncer is exposed - #48

Open
olucasandrade wants to merge 1 commit into
openeverest:mainfrom
olucasandrade:fix/connection-host-load-balancer
Open

olucasandrade wants to merge 1 commit into
openeverest:mainfrom
olucasandrade:fix/connection-host-load-balancer

Conversation

@olucasandrade

Copy link
Copy Markdown

Fixes #46

Summary

The connection host came from the user secret's pgbouncer-host, which is always the in-cluster Service name, so status.host was never used. A client outside the cluster got an unresolvable host even with PgBouncer as a LoadBalancer.

What changed

  • When spec.proxy.pgBouncer.expose.type is LoadBalancer, Host is the operator's status.host and the URI host is rewritten to match (port, credentials, path and query kept).
  • Until the load balancer has an address, the Instance stays Provisioning with waiting for the pgbouncer load balancer address.
  • Unit tests for the two new helpers.

Verification

  • go vet ./internal/... and go test ./internal/provider: pass.

Not verified

  • Not run on a real cluster with a provisioned load balancer.
  • The Provisioning branch in Status has no test; the repo has no Status tests to extend.
  • golangci-lint not run.

The connection host came from the user secret's pgbouncer-host, which is always
the in-cluster Service name. When PgBouncer is a LoadBalancer, use the
operator's status.host, rewrite the URI host to match, and stay Provisioning
until the load balancer has an address.

Fixes openeverest#46

Signed-off-by: Lucas Andrade <lafdesouza2002@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug : connection host is the in-cluster PgBouncer name even when PgBouncer is exposed as a LoadBalancer

1 participant