aiven/aiven-operator

connectionpool.connInfoSecretTarget does not expose CONNECTIONPOOL_NAME

Closed this issue · 6 comments

It is not possible to get the name of the connectionpool from connInfoSecretTarget. The exposed vars in the secrets are:

DATABASE_URI
PGDATABASE
PGHOST
PGPASSWORD
PGPORT
PGSSLMODE
PGUSER

DATABASE_URI does include the connection pool name, but the value as a whole is not easy to consume for an application via ENVs in our environment.

Is it possible to add the name of the connection pool to the resulting secret ?

I looked at the code, but it wasn't clear to me how this secret is populated with values.Attempt is in the branch

Hey @toredash
Thanks for the report. Let me take a look at this. I'll be right back with a fix.

Connection pool name is actually the CR name. We just need to expose it. connectionpool_controller.go

@byashimov Could I ask if it is possible to correct the PGPORT that is exposed as well ? The DATABASE_URI uses the correct one 26587, but the PGPORT entry is 26586.

Example:

DATABASE_URI: postgres://:26587/connection-pool?sslmode=require
PGPORT: "26586"

@toredash hey. Thanks for that. I've pushed a fix. I'll release v0.16.1 tomorrow asap 🙏

@byashimov thanks! Similar issues are present in #562. Thanks for quick turnaround