cloud-native-toolkit / cloud-native-toolkit/ibm-garage-cloud-cli
support KUBECONFIG which contains a list of files
- Dominant language
- TypeScript
- Stars
- 15
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Per the spec (https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) the KUBECONFIG environment variable may contain a list of configuration files (using the platform-specific convention of `:` or `;` to separate list elements).
When using igc 0.2.15, I found the that `igc pipeline` command fails if KUBECONFIG is set to a path (as opposed to being set to a single file). The output is
```
daves-mbp:inventory-management-bff-iz-solsa dgrove$ igc pipeline
Error registering pipeline: Cannot read property 'namespace' of undefined
```
I also see that if I run the ibm-garage-cloud-cli test suite (clone repo, build, npm run test) that two unit tests fail (log appended) when run in an environment where KUBECONFIG contains a list, but pass if I change my KUBECONFIG to contain just a single element.
```
FAIL src/api/kubectl/role-binding.spec.ts
● role-binding › canary verifies test infrastructure
TypeError: Cannot read property 'namespace' of undefined
at convertKubeconfig (node_modules/kubernetes-client/backends/request/config.js:60:29)
at new Request (node_modules/kubernetes-client/backends/request/client.js:112:26)
at new Client (node_modules/kubernetes-client/lib/swagger-client.js:203:19)
at new Client1_13 (node_modules/kubernetes-client/lib/swagger-client.js:225:5)
at KubeClientProvider.get (src/api/kubectl/client.ts:408:12)
at LocalScope.Object..LocalScope.resolve (node_modules/typescript-ioc/src/typescript-ioc.ts:523:25)
at ConfigImpl.Object..ConfigImpl.getInstance (node_modules/typescript-ioc/src/typescript-ioc.ts:461:30)
at Function.Object..IoCContainer.get (node_modules/typescript-ioc/src/typescript-ioc.ts:316:23)
at Function.Object..Container.get (node_modules/typescript-ioc/src/typescript-ioc.ts:238:29)
at Object.get (src/api/kubectl/role-binding.ts:311:42)
● role-binding › given updateWithNamespace() › when called › then update the namespace of each subject and in the metadata
TypeError: Cannot read property 'namespace' of undefined
at convertKubeconfig (node_modules/kubernetes-client/backends/request/config.js:60:29)
at new Request (node_modules/kubernetes-client/backends/request/client.js:112:26)
at new Client (node_modules/kubernetes-client/lib/swagger-client.js:203:19)
at new Client1_13 (node_modules/kubernetes-client/lib/swagger-client.js:225:5)
at KubeClientProvider.get (src/api/kubectl/client.ts:408:12)
at LocalScope.Object..LocalScope.resolve (node_modules/typescript-ioc/src/typescript-ioc.ts:523:25)
at ConfigImpl.Object..ConfigImpl.getInstance (node_modules/typescript-ioc/src/typescript-ioc.ts:461:30)
at Function.Object..IoCContainer.get (node_modules/typescript-ioc/src/typescript-ioc.ts:316:23)
at Function.Object..Container.get (node_modules/typescript-ioc/src/typescript-ioc.ts:238:29)
at Object.get (src/api/kubectl/role-binding.ts:311:42)
● role-binding › given updateWithNamespace() › when called › then update the namespace of each subject and in the metadata
TypeError: Cannot read property 'updateWithNamespace' of undefined
33 | const toNamespace = 'toNamespace';
34 |
> 35 | const result = classUnderTest.updateWithNamespace(roleBinding, toNamespace);
| ^
36 |
37 | expect(result.metadata.namespace).toEqual(toNamespace);
38 | expect(result.subjects[0].namespace).toEqual(toNamespace);
at Object. (src/api/kubectl/role-binding.spec.ts:35:39)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.