network create: match each --ip-range to its subnet for dual-stack#5018
Open
mayur-tolexo wants to merge 1 commit into
Open
network create: match each --ip-range to its subnet for dual-stack#5018mayur-tolexo wants to merge 1 commit into
mayur-tolexo wants to merge 1 commit into
Conversation
5b9ee6a to
e0eb1c7
Compare
network create applied a single --ip-range to every subnet, so on a dual-stack network the IPv4 range was checked against the IPv6 subnet and creation failed with "no matching subnet". Accept --ip-range more than once and match each range to the subnet that contains it, the same way --gateway is handled. Signed-off-by: Mayur Das <mayur.das@neevcloud.com>
e0eb1c7 to
9f7761b
Compare
Contributor
Author
|
Ran this locally against Docker to make sure the dual-stack behaviour lines up. Each Docker: nerdctl with this PR: Same addresses on both. And the host-local ranges nerdctl writes out, to show each range landed under the right subnet instead of being checked against the wrong family: |
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.
Follow-up from #5012.
nerdctl network createtook a single--ip-rangeand applied it to every subnet, so on a dual-stack network the IPv4 range was checked against the IPv6 subnet and creation failed with "no matching subnet". This makes--ip-rangerepeatable and matches each range to the subnet that contains it, the same way--gatewaydoes.Checked against Docker 29.4.0:
docker network create --ip-rangeis anipNetSlice(repeatable, one per subnet) and pairs each range with the subnet that contains it, order-independent; a range that matches no subnet errors. nerdctl now behaves the same.Based on #5010 — it reuses the
parseIPAMRangesper-subnet matching from that PR, so until #5010 merges this shows both commits. I'll rebase to the single ip-range commit once it lands.The dual-stack end-to-end path is covered by a new
network createintegration subtest (dual-stack with explicit ip-ranges).