From 35a33ae16a054db2f76f42ca7d056f97a30ba484 Mon Sep 17 00:00:00 2001 From: Paul Yu Date: Tue, 21 Jan 2025 21:10:36 -0500 Subject: [PATCH] fix a bug --- cni/network/invoker_cns.go | 2 +- cns/middlewares/k8sSwiftV2_windows.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cni/network/invoker_cns.go b/cni/network/invoker_cns.go index 02e0ce7351..78a0907a44 100644 --- a/cni/network/invoker_cns.go +++ b/cni/network/invoker_cns.go @@ -362,7 +362,7 @@ func getRoutes(cnsRoutes []cns.Route, skipDefaultRoutes bool) ([]network.RouteIn } gw := net.ParseIP(route.GatewayIPAddress) - if gw == nil && skipDefaultRoutes { + if skipDefaultRoutes { return nil, errors.Wrap(errInvalidGatewayIP, route.GatewayIPAddress) } diff --git a/cns/middlewares/k8sSwiftV2_windows.go b/cns/middlewares/k8sSwiftV2_windows.go index 58cfdf8144..1a273a608c 100644 --- a/cns/middlewares/k8sSwiftV2_windows.go +++ b/cns/middlewares/k8sSwiftV2_windows.go @@ -1,7 +1,6 @@ package middlewares import ( - "net" "net/netip" "github.com/Azure/azure-container-networking/cns"