Add pg_ident.conf passthrough field to Patroni spec#3090
Open
The127 wants to merge 1 commit into
Open
Conversation
Mirrors the existing pg_hba passthrough (zalando#361). Patroni supports pg_ident natively under postgresql.pg_ident; this exposes it through the Postgresql CRD so users can configure ident maps from the manifest. Useful for any auth method that uses pg_hba `map=...`: cert auth, GSS, PAM, peer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Patroni already supports pg_ident.conf natively under
postgresql.pg_ident(a list of lines, same shape aspg_hba). This PR exposes it through the Postgresql CRD so users can configure ident maps from the manifest, mirroring the existingpg_hbapassthrough (#361).Use cases: cert auth with
map=...(mapping client cert SAN/CN to PG roles), GSS principal stripping, PAM username rewrites, peer auth maps. Anywhere apg_hbaline usesmap=mapname, you currently can't supply the mapping rules without forking.Implementation mirrors
pg_hba:PgIdent []stringon thePatronistructcheckAndSetGlobalPostgreSQLConfigurationValidation is delegated to Patroni/Postgres on reload, same as
pg_hba. The operator doesn't parse the lines.Known Patroni quirk (not introduced by this PR)
On fresh
initdbbootstrap, Patroni stagespg_identin its local config but doesn't flush it topg_ident.confuntil the first reload.bootstrap.py's initdb path callsappend_pg_hba()but has no equivalentreplace_pg_ident()call. Subsequent config changes (including no-op reconciles) flush it correctly. Verified end-to-end on minikube with this PR's code.This is upstream Patroni, not the operator. Fix filed at patroni/patroni#3596.
Checklist
make codegen(deepcopy + both CRD yamls)k8sres_test.go,util_test.go)