From edf2b03c22749f52155b066276be89e2de6f3416 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Wed, 3 Jul 2019 22:21:20 -0400 Subject: [PATCH] Fix error deleting temporal directory in case of errors (#4257) --- build/run-ingress-controller.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/run-ingress-controller.sh b/build/run-ingress-controller.sh index eb629953a..5d9b9686e 100755 --- a/build/run-ingress-controller.sh +++ b/build/run-ingress-controller.sh @@ -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 \