Skip to content

Commit 17e6b0d

Browse files
szachovyCopilot
andcommitted
Clean up keepalived routes before Terraform destroy in CI
Add a pre-destroy step that removes stale keepalived routes and VIP addresses from the host routing table. Runs unconditionally (always) so Terraform destroy succeeds cleanly after keepalived modifications. Closes #55 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0ab8ce7 commit 17e6b0d

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ jobs:
8080
with:
8181
path: "/tmp/superset_cluster_testsuite.log"
8282

83+
- name: "Clean up keepalived routes"
84+
run: |
85+
sudo ip route | grep -E 'proto keepalived|172\.18\.0\.10' | while read -r route; do
86+
sudo ip route del $route 2>/dev/null || true
87+
done
88+
sudo ip addr show | grep -oP '172\.18\.0\.10/\d+' | while read -r addr; do
89+
sudo ip addr del "$addr" dev $(ip route get 172.18.0.10 2>/dev/null | grep -oP 'dev \K\S+' || echo lo) 2>/dev/null || true
90+
done
91+
if: "${{ always() }}"
92+
8393
- name: "Destroy Terraform environment"
8494
run: "terraform destroy --auto-approve"
8595
if: "${{ always() }}"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
* CI workflow to build and push service images to GitHub Container Registry on master merge. (#97)
1717
* Pull-first with local build fallback for container images during deployment. (#97)
1818

19+
### Fixed
20+
21+
* Clean up keepalived routes before Terraform destroy in CI. (#55)
22+
1923
### Changed
2024

2125
* Completed [ARCHITECTURE.md](./docs/ARCHITECTURE.md) (#93)

0 commit comments

Comments
 (0)