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

Function TestInsecureOverridesCA

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

Source from the content-addressed store, hash-verified

139}
140
141func TestInsecureOverridesCA(t *testing.T) {
142 config := createCAValidTestConfig()
143 clientBuilder := NewNonInteractiveClientConfig(*config, "clean", &ConfigOverrides{
144 ClusterInfo: clientcmdapi.Cluster{
145 InsecureSkipTLSVerify: true,
146 },
147 }, nil)
148
149 actualCfg, err := clientBuilder.ClientConfig()
150 if err != nil {
151 t.Errorf("Unexpected error: %v", err)
152 }
153
154 matchBoolArg(true, actualCfg.Insecure, t)
155 matchStringArg("", actualCfg.TLSClientConfig.CAFile, t)
156 matchByteArg(nil, actualCfg.TLSClientConfig.CAData, t)
157}
158
159func TestMergeContext(t *testing.T) {
160 const namespace = "overridden-namespace"

Callers

nothing calls this directly

Calls 7

createCAValidTestConfigFunction · 0.85
matchBoolArgFunction · 0.85
matchStringArgFunction · 0.85
matchByteArgFunction · 0.85
ClientConfigMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected