remove ServerAPIVersions from client

hard-code the groupVersion in SetKubernetesDefaults
This commit is contained in:
Chao Xu
2015-12-10 17:51:32 -08:00
parent 5fb943950d
commit f2edba3bec
7 changed files with 26 additions and 71 deletions

View File

@@ -235,29 +235,6 @@ func TestGetServerResources(t *testing.T) {
}
}
func TestGetServerAPIVersions(t *testing.T) {
versions := []string{"v1", "v2", "v3"}
expect := unversioned.APIVersions{Versions: versions}
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
output, err := json.Marshal(expect)
if err != nil {
t.Errorf("unexpected encoding error: %v", err)
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
w.Write(output)
}))
client := NewOrDie(&Config{Host: server.URL})
got, err := client.ServerAPIVersions()
if err != nil {
t.Fatalf("unexpected encoding error: %v", err)
}
if e, a := expect, *got; !reflect.DeepEqual(e, a) {
t.Errorf("expected %v, got %v", e, a)
}
}
func swaggerSchemaFakeServer() (*httptest.Server, error) {
request := 1
var sErr error