Upstream 2071 - Add postgres_extra_settings for postgresql.conf overrides - #30
Open
blaipr wants to merge 1 commit into
Open
Upstream 2071 - Add postgres_extra_settings for postgresql.conf overrides#30blaipr wants to merge 1 commit into
blaipr wants to merge 1 commit into
Conversation
…ides Adds a postgres_extra_settings field to the AWX CRD. When set, the operator renders a ConfigMap of postgresql.conf overrides and mounts it into the managed postgres pod, superseding the deprecated postgres_extra_args. The upstream change targets roles/installer/tasks/database.yml, which this fork does not have; its contents live in database_configuration.yml here. The ConfigMap task is placed at the matching point, after the database configuration facts are set and before the statefulset that mounts it. Ports ansible/awx-operator#2071.
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.
Upstream PR: ansible/awx-operator#2071
SUMMARY
Adds a
postgres_extra_settingsfield to theAWXCRD. When set, the operator renders a ConfigMap ofpostgresql.confoverrides and mounts it into the managed postgres pod:This supersedes
postgres_extra_args, which upstream marks deprecated in the same change. That variable exists in this fork too, so the deprecation note applies as written.Every template hunk is gated on
postgres_extra_settings | length > 0, so with the field unset the rendered StatefulSet is unchanged.ADDITIONAL INFORMATION
This one needed real adaptation rather than a clean cherry-pick, so the deviations from upstream are worth stating up front.
Task layout. Upstream applies the ConfigMap in
roles/installer/tasks/database.yml. This fork has no such file — upstream split it out after the fork point, and its contents are still insidedatabase_configuration.ymlhere (the two files' tails are identical). I placed the task at the equivalent point: immediately afterSet database as managed, which is where upstream's ordering puts it relative to the surrounding tasks, and well before the statefulset that mounts the ConfigMap is applied.Dropped from the upstream hunk. The conflicting hunk in
statefulsets/postgres.yaml.j2bundled two things belonging to other upstream changes:postgres_annotations(from #1829) — not ported to this fork, andpostgres_annotationsis not defined inroles/installer/defaults/main.yml. Taking it verbatim would have put an undefined variable into the postgres StatefulSet template for every managed-database deploy.checksum-secret-postgres_configuration_secret— unrelated to this feature.I kept only the
checksum-postgres_extra_settingsannotation this feature needs, and wrappedannotations:inside the same conditional so an emptyannotations:key isn't emitted when the field is unset.Also dropped: upstream's
.gitignoreentry forhacking/anddev/awx-cr/awx-db-configuration.cr.yml— this fork has nodev/directory.Verified rather than assumed: the ConfigMap mounts at
/opt/app-root/src/postgresql-cfg, which is the sclorg config include directory, and this fork's_postgres_imageisquay.io/sclorg/postgresql-15-c9s, so the path is right. The new template's../common/templates/labels/common.yaml.j2lookup is the same one the existingconfigmaps/config.yaml.j2uses.Not verified: I have no cluster to deploy this against, so it is untested beyond reading. The CRD parses.
The docs hunk lands in
docs/user-guide/database-configuration.md, which #17 also touches, so one of the two will need a rebase.ISSUE TYPE
COMPONENT NAME