fix(network): stop injecting ipRange into the CNI config#5078
Draft
mayur-tolexo wants to merge 1 commit into
Draft
fix(network): stop injecting ipRange into the CNI config#5078mayur-tolexo wants to merge 1 commit into
mayur-tolexo wants to merge 1 commit into
Conversation
host-local's IPAM range has no ipRange field, so `network create --ip-range` was writing a property the plugin ignores into the on-disk conflist. Drop it and instead recompute the range CIDR from rangeStart/rangeEnd when reporting IPRange in `network inspect`, which is the only place the value was read back. Fixes containerd#5068 Signed-off-by: Mayur Das <mayur.das@neevcloud.com>
mayur-tolexo
force-pushed
the
fix/network-iprange-cni
branch
from
July 17, 2026 09:53
c7aebfd to
7191d26
Compare
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.
Fixes #5068.
network create --ip-rangewas writing anipRangeproperty into the host-local IPAM ranges on disk, but host-local has no such field — it only readssubnet/rangeStart/rangeEnd/gatewayand silently ignores anything else. So the property never affected allocation; it was only being read back bynetwork inspect(via case-insensitive JSON) to report Docker'sIPRange.This drops the field from the CNI config and instead recomputes the range CIDR from
rangeStart/rangeEndat inspect time.FirstIPInSubnetonly bumps the network's last byte andLastIPInSubnetgives the broadcast, so the bounds invert cleanly back to the original CIDR.network inspectstill reports the sameIPRangeas before and as Docker — the existing inspect e2e that asserts it is unchanged, plus a unit test covers the reconstruction across v4/v6 prefixes.Same class of issue as
--aux-addressin #5041; there the reserved pairs aren't derivable so they move to a nerdctl label, whereasipRangeis fully derivable and needs no storage.Keeping this a draft until #5041 settles, since both touch the same IPAM code and I'll rebase whichever lands second.