Skip to content

✨ infer IP version from subnet CIDR on creation - #3276

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:mainfrom
Jamstah:ipv6-create-subnet
Jul 30, 2026
Merged

✨ infer IP version from subnet CIDR on creation#3276
kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:mainfrom
Jamstah:ipv6-create-subnet

Conversation

@Jamstah

@Jamstah Jamstah commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Subnet creation was unconditionally passing IPVersion 4 to OpenStack, which would cause IPv6 subnets to be created with the wrong IP version. The fix parses the CIDR and selects IPv6 when the network address has no IPv4 representation. Tests are extended to cover both the create and reconcile-existing paths for an IPv6 CIDR.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1587

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2026
@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
🔨 Latest commit d4ad527
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-openstack/deploys/6a67533a73a61d000820399c
😎 Deploy Preview https://deploy-preview-3276--kubernetes-sigs-cluster-api-openstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @Jamstah!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-openstack 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-openstack has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 23, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @Jamstah. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 23, 2026
@Jamstah

Jamstah commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

/hold cancel

@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2026
@lentzi90

Copy link
Copy Markdown
Contributor

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 27, 2026
Subnet creation was unconditionally passing IPVersion 4 to OpenStack,
which would cause IPv6 subnets to be created with the wrong IP version.
The fix parses the CIDR and selects IPv6 when the network address has
no IPv4 representation. Tests are extended to cover both the create
and reconcile-existing paths for an IPv6 CIDR.

Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
@Jamstah
Jamstah force-pushed the ipv6-create-subnet branch from 3eda05a to d4ad527 Compare July 27, 2026 12:46
@Jamstah

Jamstah commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

/retest-required

@lentzi90 lentzi90 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.

Thanks, this looks good!
I would call this a feature though.
/retitle ✨ infer IP version from subnet CIDR on creation
/approve

@kubernetes-prow kubernetes-prow Bot changed the title 🐛 fix(networking): infer IP version from subnet CIDR on creation ✨ infer IP version from subnet CIDR on creation Jul 30, 2026
@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 30, 2026

@nikParasyr nikParasyr 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.

/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 30, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lentzi90, nikParasyr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot merged commit 910348d into kubernetes-sigs:main Jul 30, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from Inbox to Done in CAPO Roadmap Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

enable automatic creation of IPv6-subnets

3 participants