#!/usr/bin/env bash # T32: kubectl delete pod에서 --grace-period 생략 시 pod spec의 # terminationGracePeriodSeconds(90s)를 따르는지, 아니면 무조건 30초로 잘리는지 실측. set -euo pipefail NS="istio-vt-t32" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" MANIFEST="${SCRIPT_DIR}/manifest.yaml" cleanup() { echo "=== cleanup: deleting namespace ${NS} ===" kubectl delete namespace "${NS}" --wait=false --ignore-not-found } trap cleanup EXIT echo "=== create namespace ${NS} (istio-injection=enabled) ===" kubectl create namespace "${NS}" kubectl label namespace "${NS}" istio-injection=enabled --overwrite echo "=== apply manifest ===" kubectl apply -f "${MANIFEST}" echo "=== wait for Ready ===" kubectl -n "${NS}" wait --for=condition=Ready pod/grace90-pod --timeout=60s echo "=== timed delete (no --grace-period flag) ===" T0=$(date +%s) kubectl -n "${NS}" delete pod grace90-pod --wait=true T1=$(date +%s) echo "actual_delete_seconds=$((T1-T0))" echo "=== events (corroboration) ===" kubectl -n "${NS}" get events --sort-by='.lastTimestamp' || true