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
|
||||
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 \
|
||||
|
|
Loading…
Reference in a new issue