astefanutti / kubebox

⎈❏ Terminal and Web console for Kubernetes
http://astefanutti.github.io/kubebox
MIT License
2.15k stars 142 forks source link

TypeError: Cannot read property 'certificatePath' of undefined #18

Closed pigletfly closed 5 years ago

pigletfly commented 5 years ago

when I run kubebox in a kubernetes cluster without certificate,a error was raised:

[eval]:367
    if (this.user.certificatePath) {
                  ^

TypeError: Cannot read property 'certificatePath' of undefined
    at Context.getMasterApi ([eval]:367:19)
    at new Kubebox ([eval]:1218:55)
    at Object.1../lib/config/context ([eval]:31:1)
    at s ([eval]:1:254)
    at e ([eval]:1:425)
    at [eval]:1:443
    at Script.runInThisContext (vm.js:65:33)
    at Object.runInThisContext (vm.js:199:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:660:30)
cscetbon commented 5 years ago

@astefanutti any idea when this bug is gonna be fixed ?

astefanutti commented 5 years ago

@cscetbon I'll try to have it fixed for the next release.

I haven't been able to reproduce though it seems it's caused by a kube config file having a context with user that cannot be found in the users section by name. Would you be able to share your kube config file or confirm that hypothesis?

cscetbon commented 5 years ago

@astefanutti, I use kubeadm-dind-cluster in my case and yeah there is no user used at all. Here is my configuration file

apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: http://127.0.0.1:32772
  name: dind
contexts:
- context:
    cluster: dind
    namespace: cassandra-e2e
    user: ""
  name: dind
current-context: dind
kind: Config
preferences: {}
astefanutti commented 5 years ago

@cscetbon thanks, that helps. I'll fix it for the next release.

astefanutti commented 5 years ago

It should be fixed with 483a00ad61e40bb2e027d1ec68d5457705bb4d2d.