feat(extensions): support underscores in extension names#9386
Merged
mnencia merged 4 commits intocloudnative-pg:mainfrom Feb 4, 2026
Merged
Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
08601c1 to
506271f
Compare
Member
|
/test |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/20066301800 |
alifarooqi
approved these changes
Dec 13, 2025
alifarooqi
approved these changes
Jan 2, 2026
3124782 to
2ba0e4e
Compare
2cc26e0 to
0274881
Compare
Collaborator
|
/test ft=image-volume-extensions |
Contributor
|
@NiccoloFei, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21628627913 |
Collaborator
|
/test |
Contributor
|
@NiccoloFei, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21629345380 |
0274881 to
2d8ac67
Compare
armru
approved these changes
Feb 3, 2026
NiccoloFei
approved these changes
Feb 3, 2026
alifarooqi
approved these changes
Feb 4, 2026
2d8ac67 to
e98d302
Compare
455c904 to
ba2d25d
Compare
mnencia
approved these changes
Feb 4, 2026
Member
|
/test |
Contributor
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21668417608 |
…olume names - Update extension name validation pattern to allow underscores in addition to hyphens - Add sanitizeExtensionNameForVolume function to convert underscores to hyphens for Kubernetes volume names - Apply sanitization to extension volume names & mount to comply with RFC 1123 DNS label requirements - Add test cases to verify underscore sanitization in volume names and mount paths - Update CRD schema to reflect new validation pattern allowing underscores Signed-off-by: Husn E Rabbi <shussan@gmail.com>
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
…lisions Add validation to detect when two extension names would result in the same Kubernetes volume name after underscore-to-hyphen sanitization (e.g., pg_ivm and pg-ivm both become pg-ivm), which would cause Kubernetes API errors. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Extension names now must start and end with alphanumeric characters, preventing invalid patterns like leading or trailing underscores. Webhook validation no longer reports redundant errors when duplicate names also cause sanitized volume name collisions. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
ba2d25d to
c690319
Compare
cnpg-bot
pushed a commit
that referenced
this pull request
Feb 4, 2026
Allow PostgreSQL extension names to contain underscores (e.g., pg_ivm, pg_stat_statements) to support standard PostgreSQL extension naming conventions that were previously rejected by CRD validation. Extension names with underscores are automatically sanitized to use hyphens for Kubernetes volume names (to comply with RFC 1123 DNS label requirements) while preserving the original name in mount paths. Webhook validation prevents naming conflicts after sanitization (e.g., pg_ivm and pg-ivm both become pg-ivm). Closes #9383 Signed-off-by: Husn E Rabbi <shussan@gmail.com> Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> (cherry picked from commit 85fa0c5)
mnencia
added a commit
that referenced
this pull request
Feb 4, 2026
Allow PostgreSQL extension names to contain underscores (e.g., pg_ivm, pg_stat_statements) to support standard PostgreSQL extension naming conventions that were previously rejected by CRD validation. Extension names with underscores are automatically sanitized to use hyphens for Kubernetes volume names (to comply with RFC 1123 DNS label requirements) while preserving the original name in mount paths. Webhook validation prevents naming conflicts after sanitization (e.g., pg_ivm and pg-ivm both become pg-ivm). Closes #9383 Signed-off-by: Husn E Rabbi <shussan@gmail.com> Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> (cherry picked from commit 85fa0c5) (cherry picked from commit a0ddd0a)
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.
Allow PostgreSQL extension names to contain underscores (e.g., pg_ivm, pg_stat_statements) to support standard PostgreSQL extension naming conventions that were previously rejected by CRD validation.
Extension names with underscores are automatically sanitized to use hyphens for Kubernetes volume names (to comply with RFC 1123 DNS label requirements) while preserving the original name in mount paths. Webhook validation prevents naming conflicts after sanitization (e.g., pg_ivm and pg-ivm both become pg-ivm).
Closes #9383