Add mcp-agent recover command

Recreates containers from the agent's SQLite registry when podman's
database is lost (UID change, podman reset, reboot). For each service
with desired_state="running" that doesn't have a running container:

- Removes any stale container with the same name
- Recreates the container from the stored spec (image, ports, volumes,
  cmd, network, user, restart policy)
- Allocates route ports and injects PORT env vars
- Re-registers mc-proxy routes
- Provisions TLS certs for L7 routes

Does NOT pull images — assumes local cache.

Root cause action item from the 2026-04-03 UID incident.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 11:50:31 -07:00
parent f9f6f339f4
commit 9d543998dc
3 changed files with 208 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ func main() {
})
root.AddCommand(snapshotCmd())
root.AddCommand(recoverCmd())
if err := root.Execute(); err != nil {
log.Fatal(err)