Skip to content

Commit

Permalink
add accelnet support on CNI (#2853)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
paulyufan2 authored Aug 7, 2024
1 parent 510c2f3 commit ae690d2
Show file tree
Hide file tree
Showing 25 changed files with 1,392 additions and 139 deletions.
6 changes: 3 additions & 3 deletions cni/network/invoker_cns.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro
// Do we want to leverage this lint skip in other places of our code?
key := invoker.getInterfaceInfoKey(info.nicType, info.macAddress)
switch info.nicType {
case cns.DelegatedVMNIC:
// only handling single v4 PodIPInfo for DelegatedVMNIC at the moment, will have to update once v6 gets added
case cns.NodeNetworkInterfaceFrontendNIC, cns.NodeNetworkInterfaceAccelnetFrontendNIC:
// only handling single v4 PodIPInfo for NodeNetworkInterfaceFrontendNIC and AccelnetNIC at the moment, will have to update once v6 gets added
if !info.skipDefaultRoutes {
numInterfacesWithDefaultRoutes++
}
Expand Down Expand Up @@ -525,7 +525,7 @@ func addBackendNICToResult(info *IPResultInfo, addResult *IPAMAddResult, key str
}

func (invoker *CNSIPAMInvoker) getInterfaceInfoKey(nicType cns.NICType, macAddress string) string {
if nicType == cns.DelegatedVMNIC || nicType == cns.BackendNIC {
if nicType == cns.NodeNetworkInterfaceFrontendNIC || nicType == cns.BackendNIC || nicType == cns.NodeNetworkInterfaceAccelnetFrontendNIC {
return macAddress
}
return string(nicType)
Expand Down
Loading

0 comments on commit ae690d2

Please sign in to comment.