so0k / powerline-kubernetes

A Powerline segment to show your current Kubernetes context
MIT License
41 stars 19 forks source link

Kube Config Context Without a Namespace Causes Error #13

Open emmercm opened 4 years ago

emmercm commented 4 years ago

I have a kubeconfig that looks like:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: ...
    server: ...
  name: ...
contexts:
- context:
    cluster: ...
    user: ...
  name: ...
current-context: ...
kind: Config
preferences: {}
users:
- name: ...
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - token
      - -i
      - ...
      command: ...
      env:
        - name: ...
          value: ...

and when I powerline-daemon --kill I get an error similar to:

2019-12-03 10:15:52,043:ERROR:shell:kubernetes:'namespace'

I think https://github.com/so0k/powerline-kubernetes/commit/c366a55de5527bf9fa9067697771fd80466fe153#diff-5206fb189568a38aa689ef479153c15d intended to fix this but there's two instances of namespace = ctx['namespace'].

mortenlj commented 4 years ago

I believe this is fixed in #14, so just need someone to merge it.

emmercm commented 4 years ago

Any update?

process0 commented 4 years ago

Experiencing this as well