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