Integration tests don't initialize with a client
Result is a 500 error if the client object is used
This commit is contained in:
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package integration
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -40,7 +41,15 @@ func TestClient(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
m := master.New(&master.Config{
|
||||
|
||||
var m *master.Master
|
||||
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
m.Handler.ServeHTTP(w, req)
|
||||
}))
|
||||
defer s.Close()
|
||||
|
||||
m = master.New(&master.Config{
|
||||
Client: client.NewOrDie(&client.Config{Host: s.URL}),
|
||||
EtcdHelper: helper,
|
||||
KubeletClient: client.FakeKubeletClient{},
|
||||
EnableLogsSupport: false,
|
||||
@@ -49,9 +58,6 @@ func TestClient(t *testing.T) {
|
||||
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
|
||||
})
|
||||
|
||||
s := httptest.NewServer(m.Handler)
|
||||
defer s.Close()
|
||||
|
||||
testCases := []string{
|
||||
"v1beta1",
|
||||
"v1beta2",
|
||||
|
Reference in New Issue
Block a user