Skip to content

Commit 25044bd

Browse files
committed
Set variable to check when it's empty
1 parent f4d5847 commit 25044bd

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

hack/lib/common-env.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ fi
1818

1919
SKIP_CREDENTIALS=${SKIP_CREDENTIALS:-""}
2020
USE_CURRENT_USER=${USE_CURRENT_USER:-""}
21+
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-""} # We check the access key
2122

2223
if [ -z "$SKIP_CREDENTIALS" ]; then
2324
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)

lab/bin/reset-environment

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,22 @@ fi
109109

110110
kubectl delete pod load-generator --ignore-not-found
111111

112-
kubectl delete namespace other --ignore-not-found
112+
# Delete namespace with timeout and handle metrics-server discovery failures
113+
kubectl delete namespace other --ignore-not-found --timeout=60s || {
114+
logmessage "⚠️ ${RED}Warning:${NC} Namespace deletion timed out or failed, forcing cleanup..."
115+
116+
# Remove finalizers to force deletion
117+
kubectl get namespace other -o json 2>/dev/null | \
118+
jq '.spec.finalizers = []' | \
119+
kubectl replace --raw "/api/v1/namespaces/other/finalize" -f - 2>/dev/null || \
120+
kubectl patch namespace other -p '{"metadata":{"finalizers":[]}}' --type=merge 2>/dev/null || true
121+
122+
# Wait a bit and verify deletion
123+
sleep 5
124+
if kubectl get namespace other &>/dev/null; then
125+
logmessage "⚠️ ${RED}Warning:${NC} Namespace 'other' still exists but continuing..."
126+
fi
127+
}
113128

114129
if [[ $module != introduction/basics* ]]; then
115130
kubectl apply -k $base_path --prune --all \

0 commit comments

Comments
 (0)