Skip to content

fix(cnpgi): support custom plugin certificate DNS names#9222

Merged
gbartolini merged 1 commit intomainfrom
dev/9218
Nov 21, 2025
Merged

fix(cnpgi): support custom plugin certificate DNS names#9222
gbartolini merged 1 commit intomainfrom
dev/9218

Conversation

@armru
Copy link
Member

@armru armru commented Nov 18, 2025

Add a new annotation cnpg.io/pluginServerName that allows customizing the DNS name used for TLS certificate verification when connecting to CNPG-I plugins.

Previously, the operator always used the Service name as the ServerName in the TLS configuration. This caused issues in environments where the plugin's certificate was issued with a different DNS name (e.g., barman-cloud.svc instead of barman-cloud).

With this change, users can specify the expected DNS name via the new annotation, enabling the operator to verify the plugin's certificate against the custom name while still connecting to the Service.

Closes #9218

@armru armru requested review from a team and jsilvela as code owners November 18, 2025 15:08
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 18, 2025
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.26 release-1.27 labels Nov 18, 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

@dosubot dosubot bot added the enhancement 🪄 New feature or request label Nov 18, 2025
@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.25 release-1.26 release-1.27 labels Nov 18, 2025
@armru armru changed the title feat: add support for custom plugin certificate DNS names feat(cnpgi): add support for custom plugin certificate DNS names Nov 18, 2025
@armru
Copy link
Member Author

armru commented Nov 18, 2025

/test limit=local

@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/19471025535

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Nov 18, 2025
pluginAddress := fmt.Sprintf("%s:%d", service.Name, pluginPort)

// Use custom server name if provided, otherwise default to service name
serverName := service.Annotations[utils.PluginServerNameAnnotationName]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it make sense to allow a comma separate list of server names?

Copy link
Member

@mnencia mnencia Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't. This is the server name the operator uses to contact the plugin. It's only one.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 20, 2025
@mnencia mnencia changed the title feat(cnpgi): add support for custom plugin certificate DNS names fix(cnpgi): add support for custom plugin certificate DNS names Nov 21, 2025
@mnencia mnencia added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.26 release-1.27 and removed do not backport This PR must not be backported - it will be in the next minor release labels Nov 21, 2025
@gbartolini gbartolini changed the title fix(cnpgi): add support for custom plugin certificate DNS names fix(cnpgi): support custom plugin certificate DNS names Nov 21, 2025
Add a new annotation `cnpg.io/pluginServerName` that allows customizing
the DNS name used for TLS certificate verification when connecting to
CNPG-I plugins.

Previously, the operator always used the Service name as the ServerName
in the TLS configuration. This caused issues in environments where the
plugin's certificate was issued with a different DNS name (e.g.,
`barman-cloud.svc` instead of `barman-cloud`).

With this change, users can specify the expected DNS name via the new
annotation, enabling the operator to verify the plugin's certificate
against the custom name while still connecting to the Service.

Fixes #9218

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@gbartolini gbartolini merged commit d475849 into main Nov 21, 2025
34 checks passed
@gbartolini gbartolini deleted the dev/9218 branch November 21, 2025 20:28
cnpg-bot pushed a commit that referenced this pull request Nov 21, 2025
Add a new annotation `cnpg.io/pluginServerName` that allows customizing
the DNS name used for TLS certificate verification when connecting to
CNPG-I plugins.

Previously, the operator always used the Service name as the ServerName
in the TLS configuration. This caused issues in environments where the
plugin's certificate was issued with a different DNS name (e.g. `barman-cloud.svc`
instead of `barman-cloud`).

With this change, users can specify the expected DNS name via the new
annotation, enabling the operator to verify the plugin's certificate
against the custom name while still connecting to the Service.

Closes #9218

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit d475849)
cnpg-bot pushed a commit that referenced this pull request Nov 21, 2025
Add a new annotation `cnpg.io/pluginServerName` that allows customizing
the DNS name used for TLS certificate verification when connecting to
CNPG-I plugins.

Previously, the operator always used the Service name as the ServerName
in the TLS configuration. This caused issues in environments where the
plugin's certificate was issued with a different DNS name (e.g. `barman-cloud.svc`
instead of `barman-cloud`).

With this change, users can specify the expected DNS name via the new
annotation, enabling the operator to verify the plugin's certificate
against the custom name while still connecting to the Service.

Closes #9218

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit d475849)
mnencia pushed a commit that referenced this pull request Nov 26, 2025
Add a new annotation `cnpg.io/pluginServerName` that allows customizing
the DNS name used for TLS certificate verification when connecting to
CNPG-I plugins.

Previously, the operator always used the Service name as the ServerName
in the TLS configuration. This caused issues in environments where the
plugin's certificate was issued with a different DNS name (e.g. `barman-cloud.svc`
instead of `barman-cloud`).

With this change, users can specify the expected DNS name via the new
annotation, enabling the operator to verify the plugin's certificate
against the custom name while still connecting to the Service.

Closes #9218

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit d475849)
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 ok to merge 👌 This PR can be merged release-1.25 release-1.26 release-1.27 size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Allow customizing plugin certificate dnsName

6 participants