kahkhang / kube-linode

:whale: Provision a Kubernetes/CoreOS cluster on Linode
MIT License
212 stars 31 forks source link

Prompt before deleting any files on teardown #84

Closed thefinn93 closed 6 years ago

thefinn93 commented 6 years ago

I was trying to figure out why my settings.env file kept getting deleted, turns out ./kube-linode.sh teardown ends with:

rm -rf cluster
rm -rf $HOME/.kube
rm auth
rm settings.env

which is very unexpected, especially deleting stuff from outside the kube-linode directory (such as $HOME/.kube). I propose prompting the user, and clearly explaining all of the files that will be deleted, maybe giving the option to preserve settings.env and/or anything that isn't in the kube-linode directory.

displague commented 6 years ago

I would also suggest that teardown should report the Linodes that it will be removing, with a prompt at the end.

The README says teardown will remove everything -- that could be explained better too.

kahkhang commented 6 years ago

Thanks for the input! Sorry I didnt realise that this command had unexpected behaviors. I've updated this command (now renamed ./kubectl destroy to emphasize the destructive nature of the command), and the command will now report the linodes that it is removing (with corresponding links to that linode's dashboard page), and it will also prompt another two times, one to prompt for DNS record deletion, and another to delete existing configuration.

Feel free to let me know if there's other stuff that can be made better / any pain points. Thanks!