Fix error deleting temporal directory in case of errors (#4257)
This commit is contained in:
parent
05e764be2c
commit
edf2b03c22
1 changed files with 8 additions and 2 deletions
|
@ -44,6 +44,9 @@ if [ "$missing" = true ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# temporal directory for the fake SSL certificate
|
||||||
|
SSL_VOLUME=$(mktemp -d)
|
||||||
|
|
||||||
function cleanup {
|
function cleanup {
|
||||||
echo -e "${BGREEN}Stoping kubectl proxy${NC}"
|
echo -e "${BGREEN}Stoping kubectl proxy${NC}"
|
||||||
rm -rf "${SSL_VOLUME}"
|
rm -rf "${SSL_VOLUME}"
|
||||||
|
@ -83,8 +86,10 @@ until curl --output /dev/null -fsSL http://localhost:8001/; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
# temporal directory for the fake SSL certificate
|
MINIKUBE_VOLUME=
|
||||||
SSL_VOLUME=$(mktemp -d)
|
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
|
# if we run as user we cannot bind to port 80 and 443
|
||||||
docker run \
|
docker run \
|
||||||
|
@ -96,6 +101,7 @@ docker run \
|
||||||
-e POD_NAME="${POD_NAME}" \
|
-e POD_NAME="${POD_NAME}" \
|
||||||
-v "${SSL_VOLUME}:/etc/ingress-controller/ssl/" \
|
-v "${SSL_VOLUME}:/etc/ingress-controller/ssl/" \
|
||||||
-v "${HOME}/.kube:${HOME}/.kube:ro" \
|
-v "${HOME}/.kube:${HOME}/.kube:ro" \
|
||||||
|
${MINIKUBE_VOLUME} \
|
||||||
"${IMAGE}-${ARCH}:local" /nginx-ingress-controller \
|
"${IMAGE}-${ARCH}:local" /nginx-ingress-controller \
|
||||||
--update-status=false \
|
--update-status=false \
|
||||||
--v=2 \
|
--v=2 \
|
||||||
|
|
Loading…
Reference in a new issue