Skip to content

Commit

Permalink
Fix ns teardown when standard deploy scripts were not used
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz committed Jan 20, 2022
1 parent 5c7fb05 commit bc4fd49
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cicd/_common_deploy_logic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ function teardown {
echo "----- TEARING DOWN -----"
echo "------------------------"
local ns
RESERVED_NAMESPACES="$DB_NAMESPACE $SMOKE_NAMESPACE"
for ns in $RESERVED_NAMESPACES; do

# run teardown on all namespaces possibly reserved in this run
RESERVED_NAMESPACES=("${NAMESPACE}" "${DB_NAMESPACE}" "${SMOKE_NAMESPACE}")
# remove duplicates (https://stackoverflow.com/a/13648438)
UNIQUE_NAMESPACES=($(echo "${RESERVED_NAMESPACES[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))

for ns in ${UNIQUE_NAMESPACES[@]}; do
echo "Running teardown for ns: $ns"
set +e
collect_k8s_artifacts $ns
Expand Down

0 comments on commit bc4fd49

Please sign in to comment.