MCPcopy
hub / github.com/kubernetes/client-go / TestCreateCleanDefaultCluster

Function TestCreateCleanDefaultCluster

tools/clientcmd/client_config_test.go:444–458  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

442}
443
444func TestCreateCleanDefaultCluster(t *testing.T) {
445 config := createValidTestConfig()
446 clientBuilder := NewDefaultClientConfig(*config, &ConfigOverrides{
447 ClusterDefaults: clientcmdapi.Cluster{Server: "http://localhost:8080"},
448 })
449
450 clientConfig, err := clientBuilder.ClientConfig()
451 if err != nil {
452 t.Fatalf("Unexpected error: %v", err)
453 }
454
455 matchStringArg(config.Clusters["clean"].Server, clientConfig.Host, t)
456 matchBoolArg(config.Clusters["clean"].InsecureSkipTLSVerify, clientConfig.Insecure, t)
457 matchStringArg(config.AuthInfos["clean"].Token, clientConfig.BearerToken, t)
458}
459
460func TestCreateMissingContextNoDefault(t *testing.T) {
461 const expectedErrorContains = "Context was not found for specified context"

Callers

nothing calls this directly

Calls 5

createValidTestConfigFunction · 0.85
NewDefaultClientConfigFunction · 0.85
matchStringArgFunction · 0.85
matchBoolArgFunction · 0.85
ClientConfigMethod · 0.65

Tested by

no test coverage detected