Commit e4bdfd05 authored by Jeff Lowdermilk's avatar Jeff Lowdermilk

Merge pull request #5060 from roberthbailey/kubectl-e2e-panic

Check for non-200 responses separately from errors from the http get.
parents a68779df 55f2da3c
...@@ -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