Production test don't cleanup flag (#44)
* Production test don't cleanup flag For use in the future with uprade tests, we add a flag -c to the production test to not cleanup after the testing. Signed-off-by: Kevin Fox <[email protected]> * Incorperate feedback Signed-off-by: Kevin Fox <[email protected]> --------- Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
@@ -19,6 +19,7 @@ helm_install=(helm upgrade --install --create-namespace)
|
||||
ns=spire-server
|
||||
|
||||
UPGRADE_ARGS=""
|
||||
CLEANUP=1
|
||||
|
||||
for i in "$@"; do
|
||||
case $i in
|
||||
@@ -26,10 +27,15 @@ for i in "$@"; do
|
||||
UPGRADE_ARGS="--repo $UPGRADE_REPO --version $UPGRADE_VERSION"
|
||||
shift # past argument=value
|
||||
;;
|
||||
-c)
|
||||
CLEANUP=0
|
||||
shift # past argument=value
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
teardown() {
|
||||
if [ "${CLEANUP}" -eq 1 ]; then
|
||||
helm uninstall --namespace "${ns}" spire 2>/dev/null || true
|
||||
kubectl delete ns "${ns}" 2>/dev/null || true
|
||||
kubectl delete ns spire-system 2>/dev/null || true
|
||||
@@ -37,6 +43,7 @@ teardown() {
|
||||
kubectl delete ns cert-manager 2>/dev/null || true
|
||||
helm uninstall --namespace ingress-nginx 2>/dev/null || true
|
||||
kubectl delete ns ingress-nginx 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
trap 'trap - SIGTERM && teardown' SIGINT SIGTERM EXIT
|
||||
|
||||
Reference in New Issue
Block a user