Fix error deleting temporal directory in case of errors (#4257)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-07-03 22:21:20 -04:00 committed by GitHub
parent 05e764be2c
commit edf2b03c22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,6 +44,9 @@ if [ "$missing" = true ]; then
exit 1
fi
# temporal directory for the fake SSL certificate
SSL_VOLUME=$(mktemp -d)
function cleanup {
echo -e "${BGREEN}Stoping kubectl proxy${NC}"
rm -rf "${SSL_VOLUME}"
@ -83,8 +86,10 @@ until curl --output /dev/null -fsSL http://localhost:8001/; do
sleep 5
done
# temporal directory for the fake SSL certificate
SSL_VOLUME=$(mktemp -d)
MINIKUBE_VOLUME=
if [[ -d "${HOME}/.minikube" ]]; then
MINIKUBE_VOLUME=" -v ${HOME}/.minikube:${HOME}/.minikube "
fi
# if we run as user we cannot bind to port 80 and 443
docker run \
@ -96,6 +101,7 @@ docker run \
-e POD_NAME="${POD_NAME}" \
-v "${SSL_VOLUME}:/etc/ingress-controller/ssl/" \
-v "${HOME}/.kube:${HOME}/.kube:ro" \
${MINIKUBE_VOLUME} \
"${IMAGE}-${ARCH}:local" /nginx-ingress-controller \
--update-status=false \
--v=2 \