Skip to content

Commit

Permalink
Not all k8s installs have /etc/kubernetes/admin.conf
Browse files Browse the repository at this point in the history
Don't die with an error in that case.
  • Loading branch information
nbartos committed Sep 22, 2017
1 parent 4fe5cf3 commit f6c6c68
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion install/k8s/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ if [ $EUID -ne 0 ]; then
exit 1
fi

kubectl="kubectl --kubeconfig /etc/kubernetes/admin.conf"
if [ -e /etc/kubernetes/admin.conf ]
then
kubectl="kubectl --kubeconfig /etc/kubernetes/admin.conf"
else
kubectl="kubectl"
fi
k8sversion=$($kubectl version --short | grep "Server Version")
if [[ "$k8sversion" == *"v1.4"* ]] || [[ "$k8sversion" == *"v1.5"* ]]; then
k8sfolder="k8s1.4"
Expand Down

0 comments on commit f6c6c68

Please sign in to comment.