Skip to content

Commit

Permalink
Revert "try cleanup before setup as well as after teardown"
Browse files Browse the repository at this point in the history
This reverts commit 1f9c7b0.
  • Loading branch information
andrewazores committed Sep 17, 2024
1 parent ace525f commit d211a08
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions k8s-test.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -x
set -xe

CLUSTER_CLIENT="${CLUSTER_CLIENT:-$(which kubectl)}"

Expand All @@ -17,17 +17,6 @@ fi
TEST_NAMESPACE="${TEST_NAMESPACE:-k8s-test}"
RELEASE_NAME="${RELEASE_NAME:-cryostat-k8s-test}"

function cleanup() {
"${CLUSTER_CLIENT}" delete ns "${TEST_NAMESPACE}"
if [ "${CREATE_CLUSTER:-true}" = "true" ]; then
kind delete cluster
fi
}
trap cleanup EXIT
cleanup

set -e

if [ "${CREATE_CLUSTER:-true}" = "true" ]; then
if ! command -v kind; then
echo "No 'kind' found in \$PATH"
Expand All @@ -37,6 +26,13 @@ if [ "${CREATE_CLUSTER:-true}" = "true" ]; then
fi

"${CLUSTER_CLIENT}" create ns "${TEST_NAMESPACE}"
function cleanup() {
"${CLUSTER_CLIENT}" delete ns "${TEST_NAMESPACE}"
if [ "${CREATE_CLUSTER:-true}" = "true" ]; then
kind delete cluster
fi
}
trap cleanup EXIT

helm install --namespace "${TEST_NAMESPACE}" "${RELEASE_NAME}" ./charts/cryostat
"${CLUSTER_CLIENT}" wait --timeout=2m --for=condition=Available=true --namespace "${TEST_NAMESPACE}" deployment -l app.kubernetes.io/name=cryostat
Expand Down

0 comments on commit d211a08

Please sign in to comment.