Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support KUBECONFIG which contains a list of files #3

Open
dgrove-oss opened this issue Nov 14, 2019 · 0 comments
Open

support KUBECONFIG which contains a list of files #3

dgrove-oss opened this issue Nov 14, 2019 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@dgrove-oss
Copy link

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.<anonymous>.LocalScope.resolve (node_modules/typescript-ioc/src/typescript-ioc.ts:523:25)
      at ConfigImpl.Object.<anonymous>.ConfigImpl.getInstance (node_modules/typescript-ioc/src/typescript-ioc.ts:461:30)
      at Function.Object.<anonymous>.IoCContainer.get (node_modules/typescript-ioc/src/typescript-ioc.ts:316:23)
      at Function.Object.<anonymous>.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.<anonymous>.LocalScope.resolve (node_modules/typescript-ioc/src/typescript-ioc.ts:523:25)
      at ConfigImpl.Object.<anonymous>.ConfigImpl.getInstance (node_modules/typescript-ioc/src/typescript-ioc.ts:461:30)
      at Function.Object.<anonymous>.IoCContainer.get (node_modules/typescript-ioc/src/typescript-ioc.ts:316:23)
      at Function.Object.<anonymous>.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.<anonymous> (src/api/kubectl/role-binding.spec.ts:35:39)
@mjperrins mjperrins added bug Something isn't working enhancement New feature or request labels Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants