Include AdditionalNetworkCIDRs in default proxy excludes

This commit is contained in:
John Gardiner Myers 2023-01-21 18:52:05 -08:00
parent 7d3c20d036
commit c905c4f827
1 changed files with 6 additions and 0 deletions

View File

@ -230,6 +230,12 @@ func assignProxy(cluster *kops.Cluster) (*kops.EgressProxySpec, error) {
klog.Warningf("No NetworkCIDR defined (yet), not adding to egressProxy.excludes")
}
for _, cidr := range cluster.Spec.Networking.AdditionalNetworkCIDRs {
if !strings.Contains(cluster.Spec.Networking.EgressProxy.ProxyExcludes, cidr) {
egressSlice = append(egressSlice, cidr)
}
}
egressProxy.ProxyExcludes = strings.Join(egressSlice, ",")
klog.V(8).Infof("Completed setting up Proxy excludes as follows: %q", egressProxy.ProxyExcludes)
} else {