feat: improve service deletion#3646
Conversation
Greptile SummaryThis PR fixes two bugs in
Confidence Score: 2/5The deletion path has multiple correctness issues that affect every service deleted without a status ID The deletion path has multiple correctness issues: the resolved service ID is not reliably written back to status, passing a value expression to go/controller/internal/controller/servicedeployment_controller.go — specifically the
|
| Filename | Overview |
|---|---|
| go/controller/internal/controller/servicedeployment_controller.go | Adds service ID lookup by name when status.ID is empty during deletion, removes the ReadOnly guard, and fixes the not-found swallow in the PatchObject defer — but introduces two defects: new(serviceID) likely sets status.ID to a zero-value pointer instead of the resolved ID, and new(common.Wait()) passes a value expression to a type-only built-in, possibly returning a zero-requeue result. Additionally, the new cluster-lookup path can permanently block finalizer removal when the cluster resource itself is gone. |
| go/controller/internal/controller/servicedeployment_controller_test.go | Adds a targeted test for the new empty-status-ID deletion path; covers the happy path (service found via API lookup and deleted) but does not exercise the cluster-not-found or cluster-not-ready error paths introduced by the new getServiceIDForDeletion helper. |
Reviews (1): Last reviewed commit: "improve service deletion" | Re-trigger Greptile
Test Plan
Test environment: https://console.your-env.onplural.sh/
Checklist
Plural Flow: console