mirror of https://github.com/k3s-io/k3s
Merge pull request #60585 from alexbrand/kubeadm-external-etcd-preflight
Automatic merge from submit-queue (batch tested with PRs 60585, 62398, 62258, 62042). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. kubeadm: surface external etcd preflight validation errors **What this PR does / why we need it**: This PR fixes a bug where errors that could occur while running preflight against an external etcd cluster were not being surfaced to the user. **Which issue(s) this PR fixes** : Fixes https://github.com/kubernetes/kubeadm/issues/719 **Release note**: ```release-note kubeadm: surface external etcd preflight validation errors ```pull/8/head
commit
8d1a4cae79
|
@ -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