File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919SKIP_CREDENTIALS=${SKIP_CREDENTIALS:- " " }
2020USE_CURRENT_USER=${USE_CURRENT_USER:- " " }
21+ AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:- " " } # We check the access key
2122
2223if [ -z " $SKIP_CREDENTIALS " ]; then
2324 ACCOUNT_ID=$( aws sts get-caller-identity --query Account --output text)
Original file line number Diff line number Diff line change 109109
110110kubectl 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
114129if [[ $module != introduction/basics* ]]; then
115130 kubectl apply -k $base_path --prune --all \
You can’t perform that action at this time.
0 commit comments