mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #5060 from roberthbailey/kubectl-e2e-panic
Check for non-200 responses separately from errors from the http get.
This commit is contained in:
commit
e4bdfd052f
@ -193,9 +193,12 @@ type updateDemoData struct {
|
||||
|
||||
func getData(podID string) (*updateDemoData, error) {
|
||||
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
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
return nil, fmt.Errorf("received non-200 status code from master: %d", resp.StatusCode)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user