fix(ipam): stop random allocation of excludeIps after IPPool reconcile - #7275
Open
zhangzujian wants to merge 6 commits into
Open
fix(ipam): stop random allocation of excludeIps after IPPool reconcile#7275zhangzujian wants to merge 6 commits into
zhangzujian wants to merge 6 commits into
Conversation
Coverage Report for CI Build 32360410414Coverage increased (+0.01%) to 32.765%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions2 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
This was referenced Aug 20, 2026
zhangzujian
force-pushed
the
fix/ipam-exclude-ips-random-alloc
branch
from
August 20, 2026 07:49
6279b6d to
7ab4cba
Compare
Member
Author
|
/test e2e core |
Contributor
|
Queued x86 E2E approval intent for current HEAD 7ab4cba. |
Contributor
|
Recorded x86 E2E approval for current HEAD 7ab4cba. |
zhangzujian
force-pushed
the
fix/ipam-exclude-ips-random-alloc
branch
from
August 20, 2026 10:10
d043392 to
72bffac
Compare
Random IPAM allocates from the in-memory free list without consulting reserved addresses. Rebuilding the default pool from V4Available during AddOrUpdateIPPool, or recycling V4Released when free is empty, can put released excludeIps back into that free list. Strip reserved addresses from both paths so ordinary pods cannot receive excluded IPs. Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Put the exclude range at the front of the usable CIDR so a leaked reserved address would be allocated first, and assert the default pool free list does not contain it after IPPool reconcile. Collapse the duplicate no-available branches on the reserved recycle path. Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
zhangzujian
force-pushed
the
fix/ipam-exclude-ips-random-alloc
branch
from
August 20, 2026 10:44
72bffac to
7ab62ab
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.
Summary
excludeIpsout of the default pool free list when an IPPool is created or reconciled. RebuildingV4Free/V6FreefromAvailablepreviously reintroduced released reserved addresses.Releasedrecycle path, so ordinary pods cannot receive excluded IPs.Released.Static allocation from
excludeIpsremains allowed.Test Plan
go test -count=1 ./pkg/ipamgo vet ./pkg/ipam