kubectx icon indicating copy to clipboard operation
kubectx copied to clipboard

Proposal: Display Message When No kubectl Contexts are Available

Open danielhelfand opened this issue 4 years ago • 4 comments

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

danielhelfand avatar Jun 11 '20 18:06 danielhelfand

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

ahmetb avatar Jun 11 '20 18:06 ahmetb

@ahmetb - May I take a gander at this?

ChaturvediSulabh avatar Aug 18 '20 11:08 ChaturvediSulabh

Go for it.

ahmetb avatar Aug 18 '20 16:08 ahmetb

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

radhouen avatar Apr 11 '21 20:04 radhouen