17 lines
488 B
Bash
Executable file
17 lines
488 B
Bash
Executable file
# Set the default kube context if present
|
|
DEFAULT_KUBE_CONTEXTS="$HOME/.kube/config"
|
|
if test -f "${DEFAULT_KUBE_CONTEXTS}"
|
|
then
|
|
export KUBECONFIG="$DEFAULT_KUBE_CONTEXTS"
|
|
fi
|
|
|
|
# Additional contexts should be in ~/.kube/custom-contexts/
|
|
CUSTOM_KUBE_CONTEXTS="$HOME/.kube/custom-contexts"
|
|
mkdir -p "${CUSTOM_KUBE_CONTEXTS}"
|
|
OIFS="$IFS"
|
|
IFS=$'\n'
|
|
for contextFile in `find "${CUSTOM_KUBE_CONTEXTS}" -type f -name "*.yml"`
|
|
do
|
|
export KUBECONFIG="$contextFile:$KUBECONFIG"
|
|
done
|
|
IFS="$OIFS"
|