Skip to content

Commit

Permalink
Merge pull request #505 from openshift-cherrypick-robot/cherry-pick-5…
Browse files Browse the repository at this point in the history
…03-to-release-4.4

[release-4.4] Bug 1806403: Don't add empty MachineCIDR to noProxy
  • Loading branch information
openshift-merge-robot committed Feb 28, 2020
2 parents 565c7e6 + 9ca668e commit befbfed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/util/proxyconfig/no_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ func MergeUserSystemNoProxy(proxy *configv1.Proxy, infra *configv1.Infrastructur
"localhost",
".svc",
".cluster.local",
ic.Networking.MachineCIDR,
)
if ic.Networking.MachineCIDR != "" {
if _, _, err := net.ParseCIDR(ic.Networking.MachineCIDR); err != nil {
return "", fmt.Errorf("MachineCIDR has an invalid CIDR: %s", ic.Networking.MachineCIDR)
}
set.Insert(ic.Networking.MachineCIDR)
}

for _, mc := range ic.Networking.MachineNetwork {
if _, _, err := net.ParseCIDR(mc.CIDR); err != nil {
Expand Down

0 comments on commit befbfed

Please sign in to comment.