Skip to content

feat(databases): add declarative FDW management to Database CRD#7942

Merged
gbartolini merged 37 commits intocloudnative-pg:mainfrom
EdwinaZhu:issue-4683-declarative-management-of-FDW
Aug 18, 2025
Merged

feat(databases): add declarative FDW management to Database CRD#7942
gbartolini merged 37 commits intocloudnative-pg:mainfrom
EdwinaZhu:issue-4683-declarative-management-of-FDW

Conversation

@EdwinaZhu
Copy link
Contributor

@EdwinaZhu EdwinaZhu commented Jun 27, 2025

Add support for managing PostgreSQL Foreign Data Wrappers (FDWs) declaratively via the spec.fdws field in the Database custom resource.

This feature enables Kubernetes-native, privilege-aware lifecycle management of FDWs without requiring direct SQL execution or superuser escalation by users.

It supports configuring name, ensure, handler, validator, owner, usage grants/revokes, and options, including the PostgreSQL "-" convention for removing handlers or validators.

Ownership changes are restricted to superusers, following PostgreSQL rules.

Only FDWs explicitly listed in spec.fdws are reconciled, leaving all others untouched.

The operator manages FDWs using PostgreSQL native CREATE FOREIGN DATA WRAPPER, ALTER FOREIGN DATA WRAPPER, and DROP FOREIGN DATA WRAPPER commands.

Closes #4683

Implemented as part of the LFX Mentorship Program 2025 Term 2.

@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.22 release-1.25 release-1.26 labels Jun 27, 2025
@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

@armru armru added 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.22 release-1.25 release-1.26 labels Jun 28, 2025
@armru armru added the no-stale label Jun 28, 2025
@EdwinaZhu
Copy link
Contributor Author

/test

@EdwinaZhu EdwinaZhu force-pushed the issue-4683-declarative-management-of-FDW branch 3 times, most recently from 6ae0c69 to c757f90 Compare July 4, 2025 14:47
@mnencia
Copy link
Member

mnencia commented Jul 4, 2025

/test

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

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

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jul 4, 2025
EdwinaZhu and others added 27 commits August 18, 2025 18:05
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
…on/test

Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
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: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
@mnencia mnencia force-pushed the issue-4683-declarative-management-of-FDW branch from abf1ad9 to 2dc2d6a Compare August 18, 2025 16:05
@gbartolini gbartolini merged commit c66e25f into cloudnative-pg:main Aug 18, 2025
29 checks passed
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 do not merge 🙅 This PR cannot be merged (yet) documentation 📖 Improvements or additions to documentation enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer no-stale 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.

Declarative Management of Foreign Data Wrappers in PostgreSQL

6 participants