New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipallocator bug if ips has leading zeros #118722
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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/test-infra repository. |
/assign @thockin |
/sig network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/lgtm
/hold
just one question, feel free to unhold or fix or just comment it in code
LGTM label has been added. Git tree hash: 0a75a2171fdd0ab5304ba3897c2315acccee0285
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
The ipallocator for the new IPAddress object use the golang big.Int library for some math operations, like adding an offset to an IP address. We use the bytes array to convert between big.Int and IP addresses, however, IP addresses are always represented as 4 or 16 bytes arrays. Big int bytes representations just return the byte array until the most representative number, this requires that we need to prepend these extra bytes for IPs with leading zeros. Change-Id: I9d539f582cae1f9f4e373b28c5b94d7a342f09c7 Signed-off-by: Antonio Ojea <aojea@google.com>
updated , @harshanarayana I need lgtm again |
/lgtm @aojea thanks for taking care of this |
LGTM label has been added. Git tree hash: 61d15a011585d40bfa01fdf1b88aeda0320d6306
|
/hold cancel concern addressed |
The ipallocator for the new IPAddress object use the golang big.Int library for some math operations, like adding an offset to an IP address.
We use the bytes array to convert between big.Int and IP addresses, however, IP addresses are always represented as 4 or 16 bytes arrays. Big int bytes representations just return the byte array until the most representative number, this requires that we need to prepend these extra bytes for IPs with leading zeros.
Change-Id: I9d539f582cae1f9f4e373b28c5b94d7a342f09c7
/kind bug
Fixes #118723
This logic is only used for the new allocator that uses IPAddress object, that is still alpha, so no need to backport or regression
Big thanks and all credit to @harshanarayana for detecting and explaining this subtle bug.