(t *testing.T)
| 469 | } |
| 470 | |
| 471 | func TestCreateMissingContext(t *testing.T) { |
| 472 | const expectedErrorContains = "context was not found for specified context: not-present" |
| 473 | config := createValidTestConfig() |
| 474 | clientBuilder := NewNonInteractiveClientConfig(*config, "not-present", &ConfigOverrides{ |
| 475 | ClusterDefaults: clientcmdapi.Cluster{Server: "http://localhost:8080"}, |
| 476 | }, nil) |
| 477 | |
| 478 | _, err := clientBuilder.ClientConfig() |
| 479 | if err == nil { |
| 480 | t.Fatalf("Expected error: %v", expectedErrorContains) |
| 481 | } |
| 482 | if !strings.Contains(err.Error(), expectedErrorContains) { |
| 483 | t.Fatalf("Expected error: %v, but got %v", expectedErrorContains, err) |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | func TestInClusterClientConfigPrecedence(t *testing.T) { |
| 488 | tt := []struct { |
nothing calls this directly
no test coverage detected