fix staticcheck failures of test/integration/scale test/integration/serviceaccount test/integration/serving test/integration/volume

This commit is contained in:
SataQiu
2019-12-30 13:35:13 +08:00
parent bd239d42e4
commit 8c77b96b75
6 changed files with 10 additions and 20 deletions

View File

@@ -292,6 +292,9 @@ func testComponent(t *testing.T, tester componentTester, kubeconfig, brokenKubec
}
body, err := ioutil.ReadAll(r.Body)
if err != nil {
t.Fatalf("failed to read response body: %v", err)
}
defer r.Body.Close()
if got, expected := r.StatusCode, *tt.wantSecureCode; got != expected {
t.Fatalf("expected http %d at %s of component, got: %d %q", expected, tt.path, got, string(body))
@@ -307,6 +310,9 @@ func testComponent(t *testing.T, tester componentTester, kubeconfig, brokenKubec
t.Fatalf("failed to GET %s from component: %v", tt.path, err)
}
body, err := ioutil.ReadAll(r.Body)
if err != nil {
t.Fatalf("failed to read response body: %v", err)
}
defer r.Body.Close()
if got, expected := r.StatusCode, *tt.wantInsecureCode; got != expected {
t.Fatalf("expected http %d at %s of component, got: %d %q", expected, tt.path, got, string(body))