-
Notifications
You must be signed in to change notification settings - Fork 386
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
Support static addresses in secondary network IPAM #3633
Conversation
This is my last planned change for secondary network IPAM. |
Codecov Report
@@ Coverage Diff @@
## main #3633 +/- ##
===========================================
- Coverage 64.54% 50.17% -14.38%
===========================================
Files 278 247 -31
Lines 39347 35658 -3689
===========================================
- Hits 25398 17890 -7508
- Misses 11967 15984 +4017
+ Partials 1982 1784 -198
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This pull request introduces 2 alerts when merging f4687bb into c463028 - view on LGTM.com new alerts:
|
26c8f58
to
7071e92
Compare
ipConfig, _ := generateIPConfig(ip, int(subnetInfo.PrefixLength), gwIP) | ||
result.IPs = append(result.IPs, ipConfig) | ||
// Add static addresses. | ||
for _, a := range ipamConf.Addresses { |
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.
This method will not require an IPPool and antrea won't check this IP is allocated by others. Is it correct?
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.
What behavior we will get if user set both IPPool and IPAddress (in this IPPool or not in this IPPool)?
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.
Yes. We do not check and users need to make sure no IP conflicts. As described in #3634 , this is just what static IPAM plugin supports (https://www.cni.dev/plugins/current/ipam/static/) and it is also supported by Whereabouts. I added it for compatibility with them.
If both Pools and static addresses are specified, we will allocate IPs from Pools and append static addresses.
Support configuring static addresses in the CNI IPAM configuration, besides allocating IPs from IPPools. Signed-off-by: Jianjun Shen <shenj@vmware.com>
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.
LGTM.
/test-all |
/test-integration |
Support configuring static addresses in the CNI IPAM configuration,
besides allocating IPs from IPPools.
Signed-off-by: Jianjun Shen shenj@vmware.com