mirror of https://github.com/k3s-io/k3s
kubeadm: surface external etcd preflight validation errors
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>pull/8/head
parent
99e77a76be
commit
b7ef952d8d
|
@ -848,13 +848,13 @@ func getEtcdVersionResponse(client *http.Client, url string, target interface{})
|
|||
r, err := client.Get(url)
|
||||
if err != nil {
|
||||
loopCount--
|
||||
return false, nil
|
||||
return false, err
|
||||
}
|
||||
defer r.Body.Close()
|
||||
|
||||
if r != nil && r.StatusCode >= 500 && r.StatusCode <= 599 {
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue