forked from rook/rook
The previous client loader routine assumed KUBECONFIG would be set in CLI environments. Instead, now take this approach: 1. If KUBECONFIG is set, that is the de-facto override that informs the tool it is being run in a CLI environment. 2. Otherwise, try creating a client from the default kube config file. 3. If that fails, assume the tool is running in a Kubernetes Pod. This will continue supporting dev/test environments so that building the rook container is not necessary for development. It also allows support for highly opinionated environments (like deployed by OpenShift CSVs) where it's not possible to install the Rook operator without also deploying a CephCluster. Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>