Files
odo/scripts/configure-cluster/common/kubeconfigreset.sh
Mohammed Ahmed e51cecfbea Configure-installer script refactor part 2 (#4292)
* Moving to static htpasswd file as it is for ephermal test cluster anyway

 - password still remains password@123

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Moving kubeadmin to its own script

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating script name

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Adding check for non-existent KUBECONFIG

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing reset_kubeconfig

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing reset_kubeconfig as it should not be called unless user wants to do it

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Addressing comment by girish

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
2021-01-14 07:05:14 -05:00

14 lines
342 B
Bash

#!/usr/bin/env bash
reset_kubeconfig() {
if [[ -z $ORIGINAL_KUBECONFIG || -z $ORIGINAL_KUBECONFIG ]]; then
echo "KUBECONFIG or ORIGINAL_KUBECONFIG not set"
exit 1
fi
if [[ $KUBECONFIG != $ORIGINAL_KUBECONFIG ]]; then
rm -rf $KUBECONFIG
fi
export KUBECONFIG=$ORIGINAL_KUBECONFIG
}
reset_kubeconfig