Skip to content

Commit

Permalink
fix log-k8s when .kube directory not present
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrand committed Mar 4, 2021
1 parent 7ab96ee commit cec94ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bosh-cli/log-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ if [ ${flagError} = 0 ] ; then
esac
done

if [ ! -d ${HOME}/.kube ] ; then
mkdir ${HOME}/.kube > /dev/null 2>&1
fi

if [ "${K8S_TYPE}" = "k8s" ] ; then
#--- Check if bosh dns exists
K8S_API_ENDPOINT="${K8S_CLUSTER}-api.internal.paas"
Expand All @@ -78,7 +82,7 @@ if [ ${flagError} = 0 ] ; then
printf "\n"
CRT_DIR=${HOME}/.kube/certs
if [ ! -d ${CRT_DIR} ] ; then
mkdir -p ${CRT_DIR} > /dev/null 2>&1
mkdir ${CRT_DIR} > /dev/null 2>&1
fi

bosh int <(credhub get -n "/${K8S_DIRECTOR}/${K8S_DEPLOYMENT}/tls-ca" --output-json) --path=/value/ca > ${CRT_DIR}/${K8S_CLUSTER}_ca.pem
Expand Down

0 comments on commit cec94ef

Please sign in to comment.