-
Notifications
You must be signed in to change notification settings - Fork 637
Calculate Postgres HBA rules in the controller #4111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We don't use it, and how to quote/escape it has been underspecified for years.
The controller assigned mandatory and default rules but did nothing
with rules defined in the spec.
The patroni.DynamicConfiguration function was interpreting its
schemaless fields while also combining Postgres HBA rules from
elsewhere. Its tests were long and complicated.
1. Postgres HBA rules are now extracted from the schemaless Patroni
field in their own function with its own tests.
2. The PostgresCluster controller now creates a single set of HBA rules
based on all the fields of the PostgresCluster spec.
3. The DynamicConfiguration function is simpler (19 lines, 18% smaller)
and easier to test.
| dynamicConfiguration: { | ||
| postgresql: { | ||
| pg_hba: [custom], | ||
| pg_hba: [calculated, elsewhere], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't come through?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't do that work anymore. Now,
patroni.PostgresHBAsreads them out,postgrescluster.generatePostgresHBAsstitches them together in the right order, then passes that result- here, to
patroni.DynamicConfigurationwhich spells them correctly as input to Patroni.
dsessler7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The controller assigned mandatory and default rules but did nothing with rules defined in the spec.
The
patroni.DynamicConfigurationfunction was interpreting its schemaless fields while also combining Postgres HBA rules from elsewhere. Its tests were long and complicated.Checklist:
Type of Changes: