Skip to content

fix(runtime): keep prepare host status unchanged#7

Merged
ZaneL1u merged 1 commit into
mainfrom
codex/fix-prepare-host-status
Jun 18, 2026
Merged

fix(runtime): keep prepare host status unchanged#7
ZaneL1u merged 1 commit into
mainfrom
codex/fix-prepare-host-status

Conversation

@ZaneL1u

@ZaneL1u ZaneL1u commented Jun 18, 2026

Copy link
Copy Markdown
Owner

变更

  • 修复 prepare_host 成功后被 actionToHostStatus 默认映射成 stopped 的问题
  • 增加回归测试,锁定 prepare_host / reload_host_bypass 不改变主机状态

根因

运行中主机被 reconciler 触发 prepare_host 网络恢复任务后,任务成功路径会调用 actionToHostStatus。旧逻辑没有显式处理 prepare_host,落入默认 stopped,导致数据库状态与 Docker 实际运行状态漂移。后台 SSH key 同步只读取 DB 中 running 主机,因此新增入站 key 被跳过并显示未同步。

验证

  • go test ./internal/runtime/tasks -run TestActionToHostStatusPrepareHostDoesNotChangeStatus -count=1
  • go test ./internal/runtime/tasks
  • go test ./...

@ZaneL1u ZaneL1u merged commit 546a323 into main Jun 18, 2026
16 checks passed
@ZaneL1u ZaneL1u deleted the codex/fix-prepare-host-status branch June 18, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant