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"