fix(deploy): tolerate absent Docker health state during router recovery
Containers without a configured HEALTHCHECK omit State.Health. Direct map field access in the new inspect template made recovery prechecks fail on longconn/edge before the router path could be repaired. Use a guarded map index and report health=none without weakening image/config/key checks. Distinguish service lookup errors from inspect/template failures instead of misreporting every query failure as no unique container. Identify the container-inspect stage in safe command errors. Add regressions for absent health state through state and the full partial router repair, plus accurate inspect failure classification. Validation: 265 passed, 3 skipped (no real PostgreSQL), 30 existing warnings; tool tests 52 passed. Python 3.7 syntax and staged diff checks pass. No remote keys/configuration or containers were changed; rerun the existing repair-router plan after updating, do not prepare or activate again.
This commit is contained in:
@@ -198,3 +198,11 @@ Windows / Python 3.12.10,平台桩、临时证书/密钥、SQLite及带Lua的F
|
||||
新增state只读查看停止/重启容器并对本地日志只提取固定错误类(包含Docker logs的stderr);run错误报告阶段/退出码而非原始配置。activate输出阶段,明确up失败可能部分切换。rollback的目标服务可为已停止的已知原/候选容器,不再因只查询运行容器而无法识别;未知镜像仍拒绝。
|
||||
|
||||
工具专项50项通过(新增state/部分回滚/错误脱敏4项、公钥修复5项、旧部分计划CLI回滚1项)。完整本地回归262 passed、3 skipped、30 warnings(49.76秒),之后追加的回滚入口检查再次通过工具50项;Python3.7语法与diff检查通过。真实PostgreSQL仍未提供。实际修复结果仍需现场执行并核验,不能把本地Docker桩通过当作router已恢复。
|
||||
|
||||
### 无Healthcheck容器导致修复前检查退出
|
||||
|
||||
现场repair-router未进入修改步骤即报docker-command失败,state能读connector/router/signer,却将longconn/edge显示为no unique。核对新版inspect模板使用`.State.Health`可选键,longconn/edge没有健康检查时Docker map模板会失败;state原先又把所有DeployError误归为容器数量问题。
|
||||
|
||||
改为`with index .State "Health"`安全读取,无字段记health=none;单独区分ServiceLookupError和容器inspect错误,命令失败阶段明确为container-inspect。新增2项回归模拟无健康检查的现有服务,覆盖state与整条部分切换repair流程以及错误分类,工具52项通过。未改配置、已生成keyring或运行容器;仍需现场更新并重跑修复核验。
|
||||
|
||||
最后完整本地回归:**265 passed,3 skipped,30 warnings**(63.22秒);真实PostgreSQL未配置,warnings类型同上,Python3.7语法及diff检查通过。
|
||||
|
||||
Reference in New Issue
Block a user