cni-ipvlan-vpc-k8s icon indicating copy to clipboard operation
cni-ipvlan-vpc-k8s copied to clipboard

Incorrect handling of errors in IPAM

Open gdearment opened this issue 6 years ago • 1 comments

The error handling in the IPAM add command is such that it is very hard to understand why something is failing. I've run into two problems that are due to the same general issue:

  1. The allocateClient doesn't differentiate between an interface already being maxed out on allowed IPv4 or IPv6 IP addresses and all IP addresses in a subnet being taken. Only the later is represented in the error here
  2. The error message from AllocateClient.AllocateIPFirstAvailableAtIndex(...) is clobbered unless there is more than one subnet that is tagged. This happens here.

For [2], if you have a single subnet for allocating Pod ENIs into, and the ENI is already attached to the host but has reached its maximum number of IPs, the error that will get returned is unable to create a new elastic network interface due to No subnets are available which haven't already been used but this is incorrect.

gdearment avatar May 14 '18 04:05 gdearment

Thanks for the report @gdearment ! I agree, this could use some improvement.

theatrus avatar May 14 '18 04:05 theatrus