Skip to content

feat: support PostgreSQL extensions in image catalogs#9781

Merged
leonardoce merged 32 commits intomainfrom
dev/8495
Mar 2, 2026
Merged

feat: support PostgreSQL extensions in image catalogs#9781
leonardoce merged 32 commits intomainfrom
dev/8495

Conversation

@NiccoloFei
Copy link
Collaborator

@NiccoloFei NiccoloFei commented Jan 20, 2026

Extend ImageCatalog and ClusterImageCatalog CRDs to allow defining
PostgreSQL extension images via the .spec.images[].extensions stanza.

This enables a "convention over configuration" approach where extension
details (image references, paths, etc.) can be centrally managed in a
catalog and inherited by Clusters.

Key behaviors:

  • Uses the same API schema as the Cluster's .spec.postgresql.extensions.
  • Supports merging: Cluster-level definitions are merged with catalog
    definitions.
  • Supports overrides: If an extension name exists in both, the Cluster's
    configuration takes precedence.
  • Acts as a default configuration layer for referenced catalogs.

Closes #8495

@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.27 release-1.28 labels Jan 20, 2026
@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@gbartolini gbartolini added enhancement 🪄 New feature or request do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.27 release-1.28 labels Jan 21, 2026
@NiccoloFei NiccoloFei marked this pull request as ready for review January 22, 2026 15:19
@NiccoloFei NiccoloFei requested review from a team, jsilvela and litaocdl as code owners January 22, 2026 15:19
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jan 22, 2026
@NiccoloFei
Copy link
Collaborator Author

/test

@github-actions
Copy link
Contributor

@NiccoloFei, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21254640342

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jan 22, 2026
@armru
Copy link
Member

armru commented Jan 26, 2026

/test

@github-actions
Copy link
Contributor

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21364009489

@NiccoloFei
Copy link
Collaborator Author

/test ft=image-volume-extensions

@github-actions
Copy link
Contributor

@NiccoloFei, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21441273493

NiccoloFei and others added 24 commits March 2, 2026 08:00
Co-authored-by: Gabriele Fedi <[email protected]>
Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Add +listType=map and +listMapKey=name markers to the Extensions
field in PostgresConfiguration, CatalogImage, and the generated
CRDs. This makes the Kubernetes API server reject duplicate
extension names without needing a webhook.

Signed-off-by: Marco Nenciarini <[email protected]>
The webhook validated extension_control_path and
dynamic_library_path for empty and duplicate values but skipped
ld_library_path, allowing invalid configurations through.

Signed-off-by: Marco Nenciarini <[email protected]>
Cover ordering independence, nil vs empty slices, and detection
of differences in image references, pull policies, extension
control paths, dynamic library paths, and ld library paths.

Signed-off-by: Marco Nenciarini <[email protected]>
During a major version upgrade, the upgrade job's main container runs
the new PostgreSQL binary but was mounting extension volumes from the
old version stored in cluster status. Thread extensions as an explicit
parameter through the volume creation chain and CreatePrimaryJob so
the major upgrade reconciler can resolve and pass new-version
extensions to the job while the init container keeps using old ones.

Signed-off-by: Marco Nenciarini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Dynamic loading of PostgreSQL extensions via image catalogs

8 participants