mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
kubeadm: surface external etcd preflight validation errors
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
This commit is contained in:
parent
99e77a76be
commit
b7ef952d8d
@ -848,13 +848,13 @@ func getEtcdVersionResponse(client *http.Client, url string, target interface{})
|
|||||||
r, err := client.Get(url)
|
r, err := client.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
loopCount--
|
loopCount--
|
||||||
return false, nil
|
return false, err
|
||||||
}
|
}
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
|
|
||||||
if r != nil && r.StatusCode >= 500 && r.StatusCode <= 599 {
|
if r != nil && r.StatusCode >= 500 && r.StatusCode <= 599 {
|
||||||
loopCount--
|
loopCount--
|
||||||
return false, nil
|
return false, fmt.Errorf("server responded with non-successful status: %s", r.Status)
|
||||||
}
|
}
|
||||||
return true, json.NewDecoder(r.Body).Decode(target)
|
return true, json.NewDecoder(r.Body).Decode(target)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user