matchai/spacefish

Implement Kubectl Context Namespace

nammn opened this issue · 5 comments

nammn commented

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:
nammn@3918534

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

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

My bad! Looks like I missed the feature being added. 😅

nammn commented

I can add a PR later, making it similar to the one developed upstream. 👍

nammn commented

Closing this issue, as pr #194 added it.