ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.71k stars 1.26k forks source link

Proposal: Display Message When No kubectl Contexts are Available #241

Open danielhelfand opened 4 years ago

danielhelfand commented 4 years ago

This is a request for a very minor detail for kubectx. The idea would be to display a message to state explicitly that no contexts are available instead of displaying nothing as kubectx currently does when no contexts are available.

Example

$ kubectx
No kubectl contexts available
ahmetb commented 4 years ago

Yeah this is doable by printing an info message to stderr. I'll keep in mind.

ChaturvediSulabh commented 4 years ago

@ahmetb - May I take a gander at this?

ahmetb commented 4 years ago

Go for it.

radhouen commented 3 years ago

Just edit the file /home/rassakra/Desktop/kubectx/cmd/kubectx/list.go by adding this code on line 47 :+1: if( len(ctx) == 0 ) { printer.Warning(stderr, "No kubectl contexts available ") } and enjoy