Skip to content

Commit

Permalink
add workaround to fix the default route issue
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyufan2 committed Oct 15, 2024
1 parent 2111502 commit 43cd9da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cns/middlewares/k8sSwiftV2_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ func (k *K8sSWIFTv2Middleware) setRoutes(podIPInfo *cns.PodIpInfo) error {
if podIPInfo.NICType == cns.InfraNIC {
logger.Printf("[SWIFTv2Middleware] skip setting default route on InfraNIC interface")
podIPInfo.SkipDefaultRoutes = true

// as a workaround, set a default route with gw 0.0.0.0 to avoid HNS setting default route to infraNIC interface
// TODO: remove this once HNS supports custom routes adding to the pod
route := cns.Route{
IPAddress: "0.0.0.0/0",
GatewayIPAddress: "0.0.0.0",
}
podIPInfo.Routes = append(podIPInfo.Routes, route)
}
return nil
}
Expand Down

0 comments on commit 43cd9da

Please sign in to comment.