tower 0.61.11 — fix delete race + force-delete patchType

End-to-end smoke surfaced two bugs that combine to nuke a fresh
instance:

1. ForceDeleteApplication was unreachable because Argo's HTTP PATCH
   is gRPC-gateway-backed and requires a structured body
   `{name, patch, patchType}` where patch is the merge-patch encoded
   as a string. We were sending a raw merge-patch with `?type=merge`,
   which Argo rejects with HTTP 500: `proto: required field
   "patchType" not set`. Result: every instance-delete in history is
   marked "failed" because force-delete fallback never worked.

2. handleCreateInstance only checked `applicationExists` for the
   conflict guard. ArgoCD's cascade can take 5+ minutes to actually
   tear down (PVC protection, dead customer cluster) — long enough
   that applicationExists returns false but the cascade is STILL
   running. If a fresh create lands in that window, the new App
   takes the same name and the stale cascade clobbers it when it
   finally finishes.

Fix #2: also reject create when an instance-delete op for the same
code is in pending/running state. Operator gets a clear "delete
still in progress — please wait" message instead of the silent
ten-minutes-later "instance vanished" failure.

Confirmed in production by op log:
  10:28:46 instance-delete odoo16 (running 6 min, finally errored
           out at 10:34:48 with the patchType marshal error)
  10:29:59 instance-create odoo16 (succeeded at 10:30:02 — landed
           inside the still-cascading window)
  10:36:08 addon-apply odoo16 (failed: HTTP 403 — Argo App gone)
This commit is contained in:
Claude
2026-04-30 13:47:55 +03:00
parent bf0c67539e
commit 44e6945aea

View File

@@ -9,7 +9,7 @@ backend:
# so every cluster that runs Tower needs the same imagePullSecret # so every cluster that runs Tower needs the same imagePullSecret
# provisioned out-of-band (until cluster-platform-v3 owns it). # provisioned out-of-band (until cluster-platform-v3 owns it).
repository: registry.odoosky.cloud/odoosky/docker-mirror/tower repository: registry.odoosky.cloud/odoosky/docker-mirror/tower
tag: "0.61.10" tag: "0.61.11"
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
imagePullSecrets: imagePullSecrets:
- name: docker-mirror-pull - name: docker-mirror-pull