reanahub / reana

REANA: Reusable research data analysis platform
https://docs.reana.io
MIT License
127 stars 54 forks source link

cli: add check to verify that reana-dev operates against kind #447

Open diegodelemos opened 4 years ago

diegodelemos commented 4 years ago

It has happened that because of a mistake, the KUBECONFIG variable was pointing to a non development instance and a reana-dev cluster-undeploy was run. Scenario:

$ export KUBECONFIG=~/important-reana-instance.config
$ # Run some commands to operate the instance above instance
$ # some time passes
$ # Continuing on the same shell or a new shell is created inheriting the environment from the current shell
$ # and a reana-dev command is run
$ reana-dev cluster-undeploy

Any reana-dev command will effectively connect to whatever instance KUBECONFIG points to, in this case ~/important-reana-instance.config, performing a destructive operation.

Shall we add a check, to verify that reana-dev is connected to kind?

tiborsimko commented 1 year ago

@mdonadoni FWIW locally on my laptop I just have unset KUBECONFIG in a script that loads my DEV, QA or PROD environment; this is useful for running things like reana-dev run-example -c DEMO --submit-only on DEV, QA, PROD. And, when I need to work with DEV, QA, PROD clusters on the Kubernetes level, then I always do it from LXPLUS, where I don't have reana-dev command in the environment. This might do to separate well local vs production manipulations, whilst still offering some reana-dev goodies that are not dangerous.