tpagectl: Service.Delete swallows cleanup errors #556

Closed
opened 2026-08-05 16:05:44 +00:00 by the.auditor · 0 comments
Owner

Service.Delete in internal/site/service.go has two robustness gaps in its cleanup path:

  1. Deployment record deletion errors are swallowed (_ = s.deployments.Delete(...)) — if a record fails to delete, orphaned deployment rows remain after the site record is gone.
  2. Kubernetes resources are deleted before the local site record; if the final s.sites.Delete fails, the site record remains but points at already-deleted resources.

Suggested fix: handle per-deployment deletion errors (return or aggregate them) and consider/document the delete ordering tradeoff (record-first vs resources-first).

Ref: PR #555

`Service.Delete` in `internal/site/service.go` has two robustness gaps in its cleanup path: 1. Deployment record deletion errors are swallowed (`_ = s.deployments.Delete(...)`) — if a record fails to delete, orphaned deployment rows remain after the site record is gone. 2. Kubernetes resources are deleted before the local site record; if the final `s.sites.Delete` fails, the site record remains but points at already-deleted resources. Suggested fix: handle per-deployment deletion errors (return or aggregate them) and consider/document the delete ordering tradeoff (record-first vs resources-first). Ref: PR #555
fuzzy closed this issue 2026-08-05 16:30:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#556
No description provided.