ipam: add AllowFirstLastIPs option to ipallocator.NewCIDRRange#45025
Open
HadrienPatte wants to merge 1 commit intomainfrom
Open
ipam: add AllowFirstLastIPs option to ipallocator.NewCIDRRange#45025HadrienPatte wants to merge 1 commit intomainfrom
AllowFirstLastIPs option to ipallocator.NewCIDRRange#45025HadrienPatte wants to merge 1 commit intomainfrom
Conversation
Member
Author
|
/test |
1 similar comment
|
/test |
pippolo84
requested changes
Mar 30, 2026
Member
pippolo84
left a comment
There was a problem hiding this comment.
Nice! Left some comments about the unneeded extra field in Range.
2572234 to
0bbca8a
Compare
Extend `NewCIDRRange` with a `WithAllowFirstLastIPs` functional option that includes the first and last IPs of a CIDR in the allocatable range. This is needed for AWS ENI prefix delegation where /28 prefixes are exclusively assigned to a node and all 16 IPs are usable as there is no shared network segment requiring base/broadcast reservation. Also refactor `ForEach` to use `r.base` directly instead of assuming a +1 offset from the CIDR base, making it correct for both default and `AllowFirstLastIPs` ranges. Relates to [cilium/design-cfps#87](cilium/design-cfps#87) Followup to #34618 See #28637 (comment) Signed-off-by: Hadrien Patte <[email protected]>
0bbca8a to
10f6fa5
Compare
Member
Author
|
@pippolo84 thanks for the review 🙇 Updated to remove |
pippolo84
approved these changes
Mar 30, 2026
Member
pippolo84
left a comment
There was a problem hiding this comment.
Nice (and thoroughly tested too)! Thanks! 💯
Member
|
/test |
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.
Extend
NewCIDRRangewith aWithAllowFirstLastIPsfunctional option that includes the first and last IPs of a CIDR in the allocatable range. This is needed for AWS ENI prefix delegation where /28 prefixes are exclusively assigned to a node and all 16 IPs are usable as there is no shared network segment requiring base/broadcast reservation.Also refactor
ForEachto user.basedirectly instead of assuming a +1 offset from the CIDR base, making it correct for both default andAllowFirstLastIPsranges.Relates to cilium/design-cfps#87
Followup to #34618
See #28637 (comment)