Skip to content

mgr/cephadm: validate mgmt-gateway virtual_ip - #71897

Merged
rkachach merged 2 commits into
ceph:mainfrom
rkachach:fix_issue_80644
Sep 21, 2026
Merged

rkachach merged 2 commits into
ceph:mainfrom
rkachach:fix_issue_80644

Conversation

@rkachach

@rkachach rkachach commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Validate MgmtGatewaySpec.virtual_ip to ensure it contains a valid IPv4 or IPv6 address.

This prevents invalid values such as hostnames or CIDR notation from being accepted and later causing TLS/SAN mismatches in the mgmt-gateway internal endpoint.

Adds unit tests for valid and invalid virtual_ip values.

Fixes: https://tracker.ceph.com/issues/80644
Assisted-by: ChatGPT <chatgpt.com>

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Validate MgmtGatewaySpec.virtual_ip to ensure it contains a valid IPv4
or IPv6 address.

This prevents invalid values such as hostnames or CIDR notation from
being accepted and later causing TLS/SAN mismatches in the
mgmt-gateway internal endpoint.

Adds unit tests for valid and invalid virtual_ip values.

Fixes: https://tracker.ceph.com/issues/80644
Assisted-by: ChatGPT <chatgpt.com>
Signed-off-by: Redouane Kachach <[email protected]>
Clarify that `mgmt-gateway.spec.virtual_ip` must be a plain IP
address, while the ingress `virtual_ip` must use the same IP with the
subnet prefix.

This avoids implying that both values should be identical strings and
makes the expected ingress CIDR format explicit.

Fixes: https://tracker.ceph.com/issues/80644
Signed-off-by: Redouane Kachach <[email protected]>

@ShwetaBhosale1 ShwetaBhosale1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes LGTM!

@rkachach

Copy link
Copy Markdown
Contributor Author

@rkachach
rkachach merged commit 420a020 into ceph:main Sep 21, 2026
14 of 15 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log 420a020a5fc82a6bb90d657759daf44b8b74b2c7^..420a020a5fc82a6bb90d657759daf44b8b74b2c7

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/35612301560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants