kubeadm: Form correct URL for IPv6 in HTTPProxy check

Force correct syntax on host/port in URL of HTTPProxy check
if the host argument is a raw IPv6 address string
This commit is contained in:
Alexander Kanevskiy
2019-09-03 15:55:58 +03:00
parent c7c89f8c61
commit 7fb4a2be41
2 changed files with 21 additions and 2 deletions

View File

@@ -590,6 +590,22 @@ func TestHTTPProxyCheck(t *testing.T) {
}, // Expected to go via proxy, range is not in 2001:db8::/48
expectWarnings: true,
},
{
name: "IPv6 direct access, no brackets",
check: HTTPProxyCheck{
Proto: "https",
Host: "2001:db8::1:15",
}, // Expected to be accessed directly, part of 2001:db8::/48 in NO_PROXY
expectWarnings: false,
},
{
name: "IPv6 via proxy, no brackets",
check: HTTPProxyCheck{
Proto: "https",
Host: "2001:db8:1::1:15",
}, // Expected to go via proxy, range is not in 2001:db8::/48
expectWarnings: true,
},
}
// Save current content of *_proxy and *_PROXY variables.