Skip to content

Commit

Permalink
Default to accelnet behavior in CNI for SwiftV2 windows (#3020)
Browse files Browse the repository at this point in the history
* modify accelnet path in cni

* remove all occurences of accelnetnic type since not sent by cns middleware

* remove all accelnet specific UTs

* remove additional UTs referring to accelnet in invoker_cns & network_test

* fix: additional UTs in endpoint_windows
invoker_mock - removed accelnet flags
  • Loading branch information
kmurudi authored Sep 24, 2024
1 parent 3a6959c commit bee72ee
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 1,103 deletions.
4 changes: 2 additions & 2 deletions cni/network/invoker_cns.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ 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.NodeNetworkInterfaceFrontendNIC, cns.NodeNetworkInterfaceAccelnetFrontendNIC:
case cns.NodeNetworkInterfaceFrontendNIC:
// 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 @@ -527,7 +527,7 @@ func addBackendNICToResult(info *IPResultInfo, addResult *IPAMAddResult, key str
}

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

0 comments on commit bee72ee

Please sign in to comment.