mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
Refactor the client (again) to better support auth
* Allows consumers to provide their own transports for common cases. * Supports KUBE_API_VERSION on test cases for controlling which api version they test against * Provides a common flag registration method for CLIs that need to connect to an API server (to avoid duplicating flags) * Ensures errors are properly returned by the server * Add a Context field to client.Config
This commit is contained in:
@@ -61,7 +61,7 @@ func TestClient(t *testing.T) {
|
||||
for apiVersion, values := range testCases {
|
||||
deleteAllEtcdKeys()
|
||||
s := httptest.NewServer(apiserver.Handle(values.Storage, values.Codec, fmt.Sprintf("/api/%s/", apiVersion), values.selfLinker))
|
||||
client := client.NewOrDie(api.NewContext(), s.URL, apiVersion, nil)
|
||||
client := client.NewOrDie(&client.Config{Host: s.URL, Version: apiVersion})
|
||||
|
||||
info, err := client.ServerVersion()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user