kubeadm: surface external etcd preflight validation errors

Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
pull/8/head
Alexander Brand 2018-04-11 09:55:16 -04:00
parent 99e77a76be
commit b7ef952d8d
No known key found for this signature in database
GPG Key ID: 4CCE2B5816854A45
1 changed files with 2 additions and 2 deletions

View File

@ -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)