(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func 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 | |
| 64 | func TestDirectClientConfig(t *testing.T) { |
| 65 | setupKubeConfigForSerialTest(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…