matchai / spacefish

πŸš€πŸŸ The fish shell prompt for astronauts
https://spacefish.matchai.dev
MIT License
963 stars 79 forks source link

Implement Kubectl Context Namespace #180

Closed nammn closed 5 years ago

nammn commented 5 years ago

Feature Request

What do you guys think of adding a namespace to the related kubectl section? Something more defined but similar to this line:


    set -l kube_context_ns (kubectl config view -o jsonpath='{.contexts[].context.namespace}' 2>/dev/null)
    [ -z $kube_context_ns ]; and return

    __sf_lib_section \
        $SPACEFISH_KUBECONTEXT_COLOR \
        $SPACEFISH_KUBECONTEXT_PREFIX \
        "$SPACEFISH_KUBECONTEXT_SYMBOL""$kube_context" \
        " as "$kube_context_ns\
        $SPACEFISH_KUBECONTEXT_SUFFIX

If so, I can open a PR for it Describe the solution you'd like Something along this:

~/.config/fish via ·icd at ☸️  bed-ussouth-db02 as default

Describe alternatives you've considered I am using this right now: https://github.com/nammn/spacefish/commit/3918534aafc6eb7144def0a2f5f8a8ab2884bedf

matchai commented 5 years ago

Hey @Fity! Thanks for opening up an issue.

This sounds like a good idea, and it sounds like it would also benefit spaceship to have it added as a feature. Since this project is aiming to achieve feature-parity with spaceship, I suggest you make an issue on that project to implement your requested feature. πŸš€

Once they've accepted it, we will gladly port it over to this project. πŸ˜„

nammn commented 5 years ago

Seems like spaceship already has it implemented. https://github.com/denysdovhan/spaceship-prompt/blob/5baa6fbc70871160c48665b14fbef57370c68c80/sections/kubecontext.zsh. Having it ported sounds great πŸ‘

matchai commented 5 years ago

My bad! Looks like I missed the feature being added. πŸ˜…

nammn commented 5 years ago

I can add a PR later, making it similar to the one developed upstream. πŸ‘

nammn commented 5 years ago

Closing this issue, as pr #194 added it.