mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
remove ServerAPIVersions from client
hard-code the groupVersion in SetKubernetesDefaults
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user