Skip to content

feat: add support for environment variables with extension images#10375

Open
NiccoloFei wants to merge 14 commits intomainfrom
10372
Open

feat: add support for environment variables with extension images#10375
NiccoloFei wants to merge 14 commits intomainfrom
10372

Conversation

@NiccoloFei
Copy link
Copy Markdown
Collaborator

@NiccoloFei NiccoloFei commented Mar 26, 2026

This patch introduces the env field within the postgresql.extensions stanza, as well as in ImageCatalog and ClusterImageCatalog resources. This allows cluster administrators to define custom environment variables that are injected into the PostgreSQL process for a given extension.

Key features:

  • Support for static environment variable definitions.
  • Dynamic placeholder expansion for ${image_root}, resolving to the extension's absolute mount path. This enables extensions to locate internal directories dynamically.
  • Validation for variable names and values.

Note: Because these variables are set at process startup, updating the env configuration requires a manual cluster restart to take effect.

Closes #10372

@NiccoloFei NiccoloFei requested review from a team and jsilvela as code owners March 26, 2026 16:46
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 26, 2026
@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 Mar 26, 2026
@github-actions
Copy link
Copy Markdown
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

@dosubot dosubot bot added the enhancement 🪄 New feature or request label Mar 26, 2026
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
NiccoloFei and others added 5 commits March 26, 2026 18:39
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 27, 2026
mnencia and others added 8 commits March 27, 2026 10:51
Move IsReservedEnvironmentVariable to pkg/postgres so both the
webhook and the instance manager use the same function. Skip
reserved and dedicated-field env vars at runtime with a warning.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Mar 28, 2026
@gbartolini gbartolini changed the title feat: enable environment variables in extension images feat: add support for environment variables with extension images Mar 28, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer release-1.25 release-1.27 release-1.28 size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Enable environment variables in extension images

4 participants