Files
ubicloud/rhizome
mohi-kalantari 499056074b Fix issue when two consecutive calls to ip generate resulted in duplicate ips
For setting up the ipv4 ip of the pod, we needed 2 ips and a function was
called twice to get the ips. On rare occasions, since the first available
ip was not accounted for, we could end up with duplicate ips. so a new
optional field was added to reserve the first ip so we would be sure we won't
end up with the same ip twice.

Some improvements were also made to improve the ipv4 ip allocation.

The old behaviour for allocating ip (both for ipv4 and ipv6) was
randomly selecting an ip and checking if it is duplicate and repeating the
process 100 times until we find an available ip. this works fine on ipv6
because ranges are so huge and the number of pods can never reach that
state.

but for ipv4, we could easily run out of available ips. in the new method,
we will generate every possible ipv4 ip (possible because ranges are so small,
definitely not possible with ipv6) and then rejecting the used ips and randomly
select one from them. This way we won't rely on luck and max retries to get the
available ip.
2025-03-27 17:51:51 +01:00
..
2025-02-14 06:58:15 -08:00
2025-02-28 11:16:23 -08:00
2023-09-06 15:20:31 +03:00