vmware-archive / ktx

manage kubernetes cluster configs
Apache License 2.0
135 stars 24 forks source link

Bug: On error ktx closes current shell #16

Closed scottslowe closed 5 years ago

scottslowe commented 5 years ago

When ktx encounters an error (for example, a user specifying a file that does not exist in the user's ~/.kube directory), it closes the current shell (instead of just reporting the error and setting an exit code).

How to reproduce:

  1. Launch a clean Bash shell with env -i bash --noprofile --norc.
  2. Source ktx into this clean Bash shell.
  3. Run ktx. It will report an error that the /.kube directory doesn't exist (it can't find it because the $HOME variable isn't defined in the environment). The clean Bash shell will terminate and return you to your original shell.
scottslowe commented 5 years ago

Some quick research suggests that we should use return 1 instead of exit 1 since this is a Bash function.

scottslowe commented 5 years ago

Closing, fixed via #18.