From e8f98e8b8f868c783709290501fb9cafc2c3d7eb Mon Sep 17 00:00:00 2001 From: toweber <> Date: Thu, 19 Dec 2024 15:31:11 +0100 Subject: [PATCH] Add mgmt subnet to no_proxy if not empty --- clab/config.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clab/config.go b/clab/config.go index 799d252c4..6a883c841 100644 --- a/clab/config.go +++ b/clab/config.go @@ -260,8 +260,12 @@ func (c *CLab) createNodeCfg(nodeName string, nodeDef *types.NodeDefinition, idx } // add mgmt subnet range for the sake of completeness - some OS support it, others don't - noProxyList = append(noProxyList, c.Config.Mgmt.IPv4Subnet) - noProxyList = append(noProxyList, c.Config.Mgmt.IPv6Subnet) + if c.Config.Mgmt.IPv4Subnet != "" { + noProxyList = append(noProxyList, c.Config.Mgmt.IPv4Subnet) + } + if c.Config.Mgmt.IPv6Subnet != "" { + noProxyList = append(noProxyList, c.Config.Mgmt.IPv6Subnet) + } // sort for better readability sort.Strings(noProxyList)