kubermatic / kubermatic/fubectl
One improvement to kube_ctx_namespace
- Dominant language
- Go
- Stars
- 1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
Hi all!
Looking for new ideas I found your project. It gave me some ones and I'd like to share my visions with you. Hope it will help you further.
https://github.com/kubermatic/fubectl/blob/3950b1e3482aff14e810af2459a6e213dd89364d/fubectl.source#L80-L85
I think the snippet above can be improved a little bit in the way as below. It requires kubectl itself and its jsonpath features that have already been embedded.
```
kubectl config view --minify \
-o jsonpath="{range .contexts[*].context}{@.user}{\"@\"}{@.cluster}{\":\"}{@.namespace}{\"\n\"}"
```
It displays the current context in the form similar to the unix prompt like `user@cluster:namespace`. It's constructed to be used directly or as an alias. You can take it as is or modify on your wants or drop as a bad idea for your project :).
Contributor guide
Research direction
Inspect kube_ctx_namespace in fubectl.source around lines 80-85, then compare its current output with the proposed kubectl config view --minify jsonpath command. Done means the current context is displayed in the suggested user@cluster:namespace form, or the project documents why the change is not suitable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, shell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100