Skip to content

Commit c9e09c0

Browse files
committed
add workaround to fix the default route issue
1 parent c5decd7 commit c9e09c0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cns/middlewares/k8sSwiftV2_windows.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ func (k *K8sSWIFTv2Middleware) setRoutes(podIPInfo *cns.PodIpInfo) error {
1414
if podIPInfo.NICType == cns.InfraNIC {
1515
logger.Printf("[SWIFTv2Middleware] skip setting default route on InfraNIC interface")
1616
podIPInfo.SkipDefaultRoutes = true
17+
18+
// as a workaround, set a default route with gw 0.0.0.0 to avoid HNS setting default route to infraNIC interface
19+
// TODO: remove this once HNS supports custom routes adding to the pod
20+
route := cns.Route{
21+
IPAddress: "0.0.0.0/0",
22+
GatewayIPAddress: "0.0.0.0",
23+
}
24+
podIPInfo.Routes = append(podIPInfo.Routes, route)
1725
}
1826
return nil
1927
}

0 commit comments

Comments
 (0)