Skip to content

fix: Render CloudNativePG application bootstrap SQL - #904

Merged
filippomc merged 2 commits into
developfrom
codex/cnpg-bootstrap-sql
Nov 23, 2026
Merged

filippomc merged 2 commits into
developfrom
codex/cnpg-bootstrap-sql

Conversation

@afonsobspinto

@afonsobspinto afonsobspinto commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Closes https://metacell.atlassian.net/browse/CH-303

Summary

CloudNativePG already supports spec.bootstrap.initdb.postInitApplicationSQL. CloudHarness previously omitted this field from the generated Cluster manifest. The operator executes the SQL once as a PostgreSQL superuser in the application database during initial initdb bootstrap. Existing clusters need a separate migration to apply the same SQL. CloudNativePG bootstrap documentation

  • Render harness.database.postgres.postInitApplicationSQL under spec.bootstrap.initdb in the generated CloudNativePG Cluster when the list is populated.
  • Preserve statement order and multiline SQL.
  • Expose the option in the values template, database guide, and OpenAPI model.
  • Cover populated and empty lists with Helm regression tests and verify model serialization.

@afonsobspinto
afonsobspinto marked this pull request as ready for review November 23, 2026 16:38
@filippomc
filippomc merged commit a021405 into develop Nov 23, 2026
10 of 11 checks passed
@filippomc
filippomc deleted the codex/cnpg-bootstrap-sql branch November 23, 2026 16:45
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