Spaceship-prompt: Openshift/Minishift issues with the kubecontext

Created on 12 Dec 2018  ·  9Comments  ·  Source: denysdovhan/spaceship-prompt

Running minishift 3.11 when the terminal comes up there is an error message.

~ at ☸️ myproject/192-168-99-100:8443/admin (myproject)

spaceship_kubecontext:21: failed to compile regex: empty (sub)expression

If I delete my .kube folder things go back as expected, but once I do an oc login and reload zsh the error comes back.

Expected behavior

I expect spaceship to act as it did previously parsing the minishift config without errors.

Below is my attached .kube/config:

apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://192.168.99.100:8443
  name: 192-168-99-100:8443
contexts:
- context:
    cluster: 192-168-99-100:8443
    namespace: default
    user: admin/192-168-99-100:8443
  name: default/192-168-99-100:8443/admin
current-context: default/192-168-99-100:8443/admin
kind: Config
preferences: {}
users:
- name: admin/192-168-99-100:8443
  user:
    token: <redacted>

Relevant Zsh configuration (.zshrc)

I've narrowed this down to only having the spaceship theme enabled.

Environment

Spaceship version: 3.8.2
Zsh version: zsh: stable 5.6.2 (bottled), HEAD
Zsh framework: oh-my-zsh>
Zsh plugin manager: None
Terminal emulator: iTerm
Operating system: macOS

Screenshot

Term output was pasted above.

Possible solution

bug

All 9 comments

I am also seeing this and I do not use Openshift/Minishift but rather Docker Desktop (on Mac) Version 2.0.0.0-mac81 (29211)

Also seeing it and it appears to have been introduced with #576. Once I set SPACESHIP_KUBECONTEXT_COLOR_GROUPS to a non-empty array it works w/o issues

@woneill Thank you for that. That does resolve it. The default of that PR suggests it is empty array by default and so should not need to be set by default so I think this issue still stands. The out-of-the-box behavior is broken.

@woneill Setting to a non-empty array fixes it for me also.

Could anyone check if it reproduces on the latest master?

@maximbaz I just pulled latest master and the issue is gone for me.

Sorry everyone for the trouble caused. Please update to latest versoin [v3.9.0] and let us know it this is resolved.

I've updated to the latest version and tested again with an unset SPACESHIP_KUBECONTEXT_COLOR_GROUPS. Looks to be fixed! Thanks!

Closing this now, Feel free to reopen or create new issue if not resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlecRust picture AlecRust  ·  3Comments

salmanulfarzy picture salmanulfarzy  ·  3Comments

jwhipp picture jwhipp  ·  3Comments

Vvkmnn picture Vvkmnn  ·  3Comments

MatthiasJ picture MatthiasJ  ·  4Comments