Skip to content

Commit ae690d2

Browse files
authored
add accelnet support on CNI (#2853)
* add accelnet support for CNI * add uts for AccelnetNIC on CNI * add more uts * fix an ut * fix uts * add ut to endpoint_test * add endpoint impl test cases for accelnet * gofummpt windows test * fix logic of accelnet * fix logic of accelnet * modify uts * remove an ut * fix one ut issue * accelnet interface should set default route * fix some uts * remove an ib ut * fix comments * fix comments and add uts * add more uts * fix an linter issue * fix comments * add comment for iov flag * fix comments * add endpoint deletion * add HNSV2 check * add UT to make sure endpoint and networ deletion called * add a new test to make infraNIC network is not deleted * add errMsg * fix error msg * add windows test cases for endpoint state deletion * fix linter issue * fix a linter issue * remove hardcode hcniov flag * comments fix * add uts for transparent network deletion * fix comment when hns id is empty * fix the UT when hns id is empty * skip linter issue * change the delegatedVMNIC to NodeNetworkInterfaceFrontendNIC * fix an ut * fix add accelnet policy setting ut
1 parent 510c2f3 commit ae690d2

25 files changed

+1392
-139
lines changed

cni/network/invoker_cns.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro
169169
// Do we want to leverage this lint skip in other places of our code?
170170
key := invoker.getInterfaceInfoKey(info.nicType, info.macAddress)
171171
switch info.nicType {
172-
case cns.DelegatedVMNIC:
173-
// only handling single v4 PodIPInfo for DelegatedVMNIC at the moment, will have to update once v6 gets added
172+
case cns.NodeNetworkInterfaceFrontendNIC, cns.NodeNetworkInterfaceAccelnetFrontendNIC:
173+
// only handling single v4 PodIPInfo for NodeNetworkInterfaceFrontendNIC and AccelnetNIC at the moment, will have to update once v6 gets added
174174
if !info.skipDefaultRoutes {
175175
numInterfacesWithDefaultRoutes++
176176
}
@@ -525,7 +525,7 @@ func addBackendNICToResult(info *IPResultInfo, addResult *IPAMAddResult, key str
525525
}
526526

527527
func (invoker *CNSIPAMInvoker) getInterfaceInfoKey(nicType cns.NICType, macAddress string) string {
528-
if nicType == cns.DelegatedVMNIC || nicType == cns.BackendNIC {
528+
if nicType == cns.NodeNetworkInterfaceFrontendNIC || nicType == cns.BackendNIC || nicType == cns.NodeNetworkInterfaceAccelnetFrontendNIC {
529529
return macAddress
530530
}
531531
return string(nicType)

0 commit comments

Comments
 (0)