When getting deallocate request, keep podName record in deallocationHistory map with start offset=1
When getting allocate request, if it is just deleted pod (recorded in deallocationHistory), it will be considered as anomaly behaviour. Then, it will increase offset by one when generate next available IP. According, it will return the different address compared to the previous allocate request (i.e., skip the problematic address)
The record is considered as expired after one minute. The deallocationHistory map will check and remove the expired record every new allocate request.
This PR also includes the test case for
anomaly allocate from beginning
anomaly allocate after some allocations
force make deallocationHistory expired and check Expired function
This PR introduces a solution to handle the issue https://github.com/foundation-model-stack/multi-nic-cni/issues/20.
Flows:
This PR also includes the test case for