Commit 55f2da3c authored by Robert Bailey's avatar Robert Bailey

Check for non-200 responses separately from errors from the http get.

Fixes #5059
parent ce908368
...@@ -193,9 +193,12 @@ type updateDemoData struct { ...@@ -193,9 +193,12 @@ type updateDemoData struct {
func getData(podID string) (*updateDemoData, error) { func getData(podID string) (*updateDemoData, error) {
resp, err := http.Get(fmt.Sprintf("http://localhost:%d/api/v1beta1/proxy/pods/%s/data.json", kubectlProxyPort, podID)) resp, err := http.Get(fmt.Sprintf("http://localhost:%d/api/v1beta1/proxy/pods/%s/data.json", kubectlProxyPort, podID))
if err != nil || resp.StatusCode != 200 { if err != nil {
return nil, err return nil, err
} }
if resp.StatusCode != 200 {
return nil, fmt.Errorf("received non-200 status code from master: %d", resp.StatusCode)
}
defer resp.Body.Close() defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) body, err := ioutil.ReadAll(resp.Body)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment