From d1c2ae310d47d1fe0fe8e6fb63a2e1fdd0107873 Mon Sep 17 00:00:00 2001 From: Paul Yu Date: Tue, 21 Jan 2025 17:46:53 -0500 Subject: [PATCH] allow gw as empty string --- cni/network/invoker_cns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) }