mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
Merge pull request #8646 from andronat/failed_test_TestCreateMissingContext
Test fails when arbitrary kubernetes master is set
This commit is contained in:
commit
b31505bfba
@ -165,12 +165,14 @@ func TestCreateMissingContext(t *testing.T) {
|
|||||||
const expectedErrorContains = "Context was not found for specified context"
|
const expectedErrorContains = "Context was not found for specified context"
|
||||||
config := createValidTestConfig()
|
config := createValidTestConfig()
|
||||||
clientBuilder := NewNonInteractiveClientConfig(*config, "not-present", &ConfigOverrides{})
|
clientBuilder := NewNonInteractiveClientConfig(*config, "not-present", &ConfigOverrides{})
|
||||||
expectedConfig := &client.Config{Host: "http://localhost:8080"}
|
|
||||||
|
|
||||||
clientConfig, err := clientBuilder.ClientConfig()
|
clientConfig, err := clientBuilder.ClientConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Unexpected error: %v", err)
|
t.Errorf("Unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expectedConfig := &client.Config{Host: clientConfig.Host}
|
||||||
|
|
||||||
if !reflect.DeepEqual(expectedConfig, clientConfig) {
|
if !reflect.DeepEqual(expectedConfig, clientConfig) {
|
||||||
t.Errorf("Expected %#v, got %#v", expectedConfig, clientConfig)
|
t.Errorf("Expected %#v, got %#v", expectedConfig, clientConfig)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user