fix(runtime): keep prepare host status unchanged#7
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
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=1go test ./internal/runtime/tasksgo test ./...