fix Python 3.8 type hint in dns_probe + tear down cluster after deploy test

dns_probe.py used 'list[str]' (PEP 585 generic alias for builtins),
which only parses on Python 3.9+. CI runs Python 3.8, so any caller
of 'deployment restart' (which lazy-imports dns_probe) crashed at
module load with 'TypeError: type object is not subscriptable'. Use
'List[str]' from typing to keep 3.8 compatibility, matching the rest
of the file's imports.

run-deploy-test.sh previously ended with --skip-cluster-management,
leaving the Kind cluster running for the next CI step to inherit.
Switch the final stop to --perform-cluster-management so subsequent
tests (e.g. run-restart-test.sh) start from a clean host, and replace
the now-trivial namespace assertion with a real check that the kind
cluster is actually gone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pull/750/head
pranav 2026-04-28 11:48:41 +00:00
parent 93b0d79998
commit 633feba3ea
2 changed files with 10 additions and 8 deletions

View File

@ -6,7 +6,7 @@
import secrets
import socket
import time
from typing import Optional
from typing import List, Optional
import requests
from kubernetes import client
@ -18,7 +18,7 @@ def get_server_egress_ip() -> str:
return response.text.strip()
def resolve_hostname(hostname: str) -> list[str]:
def resolve_hostname(hostname: str) -> List[str]:
"""Resolve hostname to list of IP addresses."""
try:
_, _, ips = socket.gethostbyname_ex(hostname)

View File

@ -413,14 +413,16 @@ if [ "$restored_value" != "$fake_cert_value" ]; then
fi
echo "caddy cert restore test: passed"
# Final teardown: --delete-namespace nukes the namespace after labeled cleanup.
# Verify the namespace is actually gone.
# Final teardown: --delete-namespace nukes the namespace, and
# --perform-cluster-management tears down the Kind cluster so the next test
# step in this CI workflow (e.g. run-restart-test.sh) starts from a clean
# host.
$TEST_TARGET_SO deployment --dir $test_deployment_dir \
stop --delete-volumes --delete-namespace --skip-cluster-management
if kubectl get namespace ${deployment_ns} >/dev/null 2>&1; then
echo "delete-namespace test: FAILED (namespace still present)"
stop --delete-volumes --delete-namespace --perform-cluster-management
if kind get clusters 2>/dev/null | grep -q .; then
echo "cluster teardown test: FAILED (kind cluster still present)"
exit 1
fi
echo "delete-namespace test: passed"
echo "cluster teardown test: passed"
echo "Test passed"