danhuawang opened a new pull request, #14941:
URL: https://github.com/apache/gravitino/pull/14941
### What changes were proposed in this pull request?
- Add `postgresql.init.host`, `postgresql.init.existingSecret`, and
`postgresql.init.existingSecretPasswordKey` so the `init-postgresql` container
can target non-Bitnami hosts and password Secrets (for example CloudNativePG).
- Render `init-postgresql` when the entity store uses an external
`jdbc:postgresql:` URL (`postgresql.enabled=false`), not only when the in-chart
Bitnami subchart is enabled.
- Centralize connection settings in helpers; use the same host in all `psql`
calls and in the init container `secretKeyRef`.
- Fail at template render when external PostgreSQL is configured but
required `postgresql.init.*` values are missing.
### Why are the changes needed?
The init container previously hardcoded `{{ .Release.Name }}-postgresql` for
both the `psql -h` host and the password Secret, and only rendered when
`postgresql.enabled` was true. That breaks external PostgreSQL / CNPG setups
described in #11696 (and made the earlier #11697 override ineffective when
`postgresql.enabled=false`).
Fixes #11696
### Does this PR introduce _any_ user-facing change?
Yes. New optional values under `postgresql.init` in
`dev/charts/gravitino/values.yaml`. Default Bitnami (`postgresql.enabled=true`)
behavior is unchanged when `postgresql.init` is empty.
### How was this patch tested?
```bash
cd dev/charts/gravitino && helm unittest .
```
All 46 chart unit tests pass, including new cases for default Bitnami
secret/host, custom `postgresql.init` overrides, external PostgreSQL entity
store, and negative render failures.
Made with [Cursor](https://cursor.com)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]