Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very long contexts when using with OpenShift #3

Open
bliemli opened this issue Mar 30, 2017 · 4 comments
Open

Very long contexts when using with OpenShift #3

bliemli opened this issue Mar 30, 2017 · 4 comments

Comments

@bliemli
Copy link

bliemli commented Mar 30, 2017

When using powerline-kubernetes with OpenShift, the context part usually gets very long, e.g.:

⎈ explore-00/master-asdf-openshift3roadshow-com:443/user00 - explore-00

A config parameter permitting to either only display the namespace or the context would be great.

@so0k
Copy link
Owner

so0k commented Apr 24, 2017

Sorry I hadn't seen this issue until just now. I'll have a look into this - thanks for suggestion.

for me, I can manage my context and namespace names as I'm working with k8s directly (and just use kubectl config set-context with the desired name), but a feature toggle what you want to display or trim either field isn't a bad idea.

If trimming, should it chop off in the front or the end?

@bliemli
Copy link
Author

bliemli commented Apr 25, 2017

Thanks for writing back. I just realized ... config set-context works for oc as well. But to answer your question: When working with OpenShift, the interesting part in the above example would simply be explore-00 in a lot of use cases. This corresponds to the NAMESPACE part of the get-context output. So maybe an idea would be to allow toggling the different fields of the get-context output, in my case:

$ oc config get-contexts 
CURRENT  NAME  CLUSTER  AUTHINFO  NAMESPACE
...

(where CURRENT doesn't contain any useful information and could probably be left out anyway).
So if I wanted to only display the NAMESPACE part I'd toggle off all other parts and only allow NAMESPACE.

@kungfuchicken
Copy link

@bliemli I think @so0k took care of this with more recent updates that let you toggle whether the context and/or namespace get added.

@rgordill
Copy link

rgordill commented Mar 2, 2020

Hi.

Why does not adds "cluster" as a new parameter? It would be easier in most of the situation to have just that instead of the context, particularly with OpenShift.

Just adding

cluster = ctx['cluster']

And the corresponding references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants