tanka icon indicating copy to clipboard operation
tanka copied to clipboard

The error for "unset $KUBECONFIG" is needlessly cryptic

Open curusarn opened this issue 4 years ago • 4 comments

Forgetting to set $KUBECONFIG results in a following error:

❯ tk diff envs/name
connecting to Kubernetes: finding usable context: expected clusters to be of type `[]map[string]interface{}`, but got `<nil>` instead

This is imho a pretty common mistake among newcomers so it would make sense to handle unset $KUBECONFIG as a separate error.

What do you think?

curusarn avatar Feb 03 '21 19:02 curusarn

I agree.. sort of? $KUBECONFIG not being set will default to the system default ($HOME/.kube/config or something), but if that is absent, yeah, probably makes sense to tell them we couldn't find anything.

captncraig avatar Feb 03 '21 19:02 captncraig

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 19 '21 22:03 stale[bot]

I'm willing to submit a PR fixing this if maintainers agree that it is a good idea.

curusarn avatar Mar 29 '21 11:03 curusarn

Sounds reasonable to me, a nice hint could help a newcomer definitely.

Duologic avatar Mar 29 '21 23:03 Duologic