Fix preview deploy: add rollout restart after kubectl apply
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 4s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 7s
Test / e2e-test (push) Failing after 22s

Without restart, K8s reuses cached pods even with imagePullPolicy: Always
when the manifest spec hasn't changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 21:35:39 +00:00
parent 8443f1a564
commit 81efad83f9

View File

@@ -198,9 +198,10 @@ def deploy(pr_id: str):
kubectl("apply", "-f", str(p))
p.unlink()
# 5. Wait for rollout
print("[5/5] Waiting for rollout...")
kubectl("rollout", "status", f"deploy/oil-calculator", "-n", ns, "--timeout=120s")
# 5. Restart to pick up new image and wait
print("[5/5] Restarting deployment...")
kubectl("rollout", "restart", "deploy/oil-calculator", "-n", ns)
kubectl("rollout", "status", "deploy/oil-calculator", "-n", ns, "--timeout=120s")
# Cleanup
run("rm -rf data/oil_calculator.db", check=False)