Skip to content

Conversation

@cbandy
Copy link
Member

@cbandy cbandy commented Feb 26, 2025

The controller assigned mandatory and default values but did nothing with values defined in the spec.

The patroni.DynamicConfiguration function was interpreting its schemaless fields while also combining Postgres parameters from elsewhere. Its tests were long and complicated.

  1. Postgres parameters are now extracted from the schemaless Patroni field in their own function with its own tests. Unusual types are handled more deliberately.
  2. The PostgresCluster controller now creates a single set of Postgres parameters based on all the fields of the PostgresCluster spec.
  3. The DynamicConfiguration function is simpler (44 lines, 30% smaller) and easier to test.

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • Testing enhancement

This field is optional, but the struct always includes it in YAML output.
The controller assigned mandatory and default values but did nothing
with values defined in the spec.

The patroni.DynamicConfiguration function was interpreting its
schemaless fields while also combining Postgres parameters from
elsewhere. Its tests were long and complicated.

 1. Postgres parameters are now extracted from the schemaless Patroni
    field in their own function with its own tests. Unusual types are
    handled more deliberately.

 2. The PostgresCluster controller now creates a single set of Postgres
    parameters based on all the fields of the PostgresCluster spec.

 3. The DynamicConfiguration function is simpler (44 lines, 30% smaller)
    and easier to test.
@cbandy cbandy enabled auto-merge (rebase) February 28, 2025 19:20
@cbandy cbandy merged commit 2a2fe9b into CrunchyData:main Feb 28, 2025
17 of 18 checks passed
@cbandy cbandy deleted the parameters branch February 28, 2025 21:26
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.

2 participants