MCPcopy Create free account
hub / github.com/containers/image / TestClientConfigLoadingRules

Function TestClientConfigLoadingRules

openshift/openshift-copies_test.go:30–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestClientConfigLoadingRules(t *testing.T) {
31 setupKubeConfigForSerialTest(t)
32
33 rules := newOpenShiftClientConfigLoadingRules()
34 res, err := rules.Load()
35 require.NoError(t, err)
36 expected := clientcmdConfig{
37 Clusters: clustersMap{
38 "172-17-0-2:8443": &clientcmdCluster{
39 LocationOfOrigin: fixtureKubeConfigPath,
40 Server: "https://172.17.0.2:8443",
41 CertificateAuthorityData: []byte("Cluster CA"),
42 },
43 },
44 AuthInfos: authInfosMap{
45 "system:admin/172-17-0-2:8443": &clientcmdAuthInfo{
46 LocationOfOrigin: fixtureKubeConfigPath,
47 ClientCertificateData: []byte("Client cert"),
48 ClientKeyData: []byte("Client key"),
49 },
50 },
51 Contexts: contextsMap{
52 "default/172-17-0-2:8443/system:admin": &clientcmdContext{
53 LocationOfOrigin: fixtureKubeConfigPath,
54 Cluster: "172-17-0-2:8443",
55 AuthInfo: "system:admin/172-17-0-2:8443",
56 Namespace: "default",
57 },
58 },
59 CurrentContext: "default/172-17-0-2:8443/system:admin",
60 }
61 assert.Equal(t, &expected, res)
62}
63
64func TestDirectClientConfig(t *testing.T) {
65 setupKubeConfigForSerialTest(t)

Callers

nothing calls this directly

Calls 3

LoadMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…