Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: surface external etcd preflight validation errors #60585

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/kubeadm/app/preflight/checks.go
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. L835 and L841 are the only two places we should change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meaning the PR should only touch these two lines? It is currently a bit more involved due to the added unit tests, and trying to avoid the tests running for longer than they need by being able to specify the retry parameters.

Is there a better approach to this? Thanks!

cc @timothysc

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

Expand Down