mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-02-22 07:03:28 +00:00
kubeadm preflight checks: fix host URL construction
This commit is contained in:
committed by
Jordan Liggitt
parent
ae85505eac
commit
9fddfce038
@@ -479,11 +479,8 @@ func (subnet HTTPProxyCIDRCheck) Check() (warnings, errorList []error) {
|
||||
return nil, []error{errors.Wrapf(err, "unable to get first IP address from the given CIDR (%s)", cidr.String())}
|
||||
}
|
||||
|
||||
testIPstring := testIP.String()
|
||||
if len(testIP) == net.IPv6len {
|
||||
testIPstring = fmt.Sprintf("[%s]:1234", testIP)
|
||||
}
|
||||
url := fmt.Sprintf("%s://%s/", subnet.Proto, testIPstring)
|
||||
testHostString := net.JoinHostPort(testIP.String(), "1234")
|
||||
url := fmt.Sprintf("%s://%s/", subnet.Proto, testHostString)
|
||||
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user