mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
Test fails when env variables are set
This commit is contained in:
parent
d9d12fd3f7
commit
66a758b85d
@ -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