diff --git a/pkg/apiserver/apiserver_test.go b/pkg/apiserver/apiserver_test.go index 49b7ca69335..a14de58ba5c 100644 --- a/pkg/apiserver/apiserver_test.go +++ b/pkg/apiserver/apiserver_test.go @@ -984,6 +984,7 @@ func TestList(t *testing.T) { t.Errorf("%d: unexpected error: %v", i, err) continue } + defer resp.Body.Close() if resp.StatusCode != http.StatusOK { t.Errorf("%d: unexpected status: %d from url %s, Expected: %d, %#v", i, resp.StatusCode, testCase.url, http.StatusOK, resp) body, err := ioutil.ReadAll(resp.Body)