Repository navigation
feat(vm): migrate legacy containers for service-only Go updates - #605
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 080ddf8. Configure here.
| }, | ||
| }, | ||
| } | ||
| } |
There was a problem hiding this comment.
Legacy slot keeps network IP
High Severity
Replacement slot bodies pin the old IPv4Address and Aliases while the renamed *-legacy-* container stays on the same user-defined network. Docker still holds that endpoint until the backup is disconnected or removed, so create fails with address or alias already in use and the one-time slot migration cannot finish.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 080ddf8. Configure here.
|
|
||
| export function needsLegacyServiceMigration(info, { sourceDir = '' } = {}) { | ||
| return !!info && !hasBindDestination(info, LIVE_BIN, sourceDir) | ||
| } |
There was a problem hiding this comment.
KVM slots migrate on Go update
High Severity
needsLegacyServiceMigration only looks for /opt/kin-live. KVM guests already bind slot-bin at /opt/kin-guest/opt/kin-live, so every telemetry or Go-only fleet update treats them as legacy, stops the runner, and recreates the VM container. That bounces the kernel instead of restarting only Go services.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 080ddf8. Configure here.
| 'Tmpfs', | ||
| 'VolumesFrom', | ||
| 'CgroupnsMode', | ||
| ]) |
There was a problem hiding this comment.
Migration drops capability settings
Medium Severity
The copied HostConfig allowlist omits CapDrop and CapAdd. Recreated slots therefore lose CapDrop: ['ALL'], and KVM runners lose CapAdd for /dev/kvm. Migrated docker guests regain default capabilities such as NET_RAW; KVM guests can fail hardware acceleration.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 080ddf8. Configure here.
Include capability fields in MIGRATION_HOST_CONFIG_KEYS so recreated egress containers keep the same hardening when canReuse skips rebuild. Document #605 in CHANGELOG. Co-authored-by: ted <kuhlmangarry24@gmail.com>
080ddf8 to
f68a465
Compare
Include capability fields in MIGRATION_HOST_CONFIG_KEYS so recreated egress containers keep the same hardening when canReuse skips rebuild. Document #605 in CHANGELOG. Co-authored-by: ted <kuhlmangarry24@gmail.com>
92fdd14 to
5532d33
Compare
Co-authored-by: ted <kuhlmangarry24@gmail.com>
Include capability fields in MIGRATION_HOST_CONFIG_KEYS so recreated egress containers keep the same hardening when canReuse skips rebuild. Document #605 in CHANGELOG. Co-authored-by: ted <kuhlmangarry24@gmail.com>
…gration Disconnect renamed legacy containers from user-defined networks before recreating with the same static address. Treat /opt/kin-guest/opt/kin-live as an already-migrated service mount. Co-authored-by: ted <kuhlmangarry24@gmail.com>
Co-authored-by: ted <kuhlmangarry24@gmail.com>
5ed423e to
2002263
Compare


变更
/opt/kin-liveGo 二进制挂载;保留停止的*-legacy-*容器用于回滚,不重建 VM、不触碰 VM 凭证。scripts/migrate-legacy-cluster-slots.mjs手动入口,支持传 VM ID 定向操作;修复远端服务刷新传递 binary digest 的运行时错误。验证
npm run build:worker、npm run build:egress:通过(仅本地构建产物,未提交)。npm run test:unit首轮:仅 2 个 OAuth 文件因隔离工作树缺少本地专有kin-oauth-auth而失败;显式设置KIN_OAUTH_AUTH_BIN=/mnt/x/vm2api/bin/kin-oauth-auth重跑该 2 文件:16 通过、6 按设计跳过。git diff --check通过。未部署到 HostDzire 或远端 VM;容器迁移会改变容器 ID,请先按节点/VM 定向验证再全量滚动。
Note
High Risk
Changes cluster container identity and SOCKS egress process management during upgrades; mis-rollout could leave slots on old binaries or briefly disrupt proxy traffic despite rollback containers.
Overview
Adds a one-time migration for cluster slots that still bind Go binaries under
/usr/local/bininstead of the persistentslot-bin→/opt/kin-livemount. On telemetry/service refresh, legacy slot and*-egresscontainers are stopped, renamed to*-legacy-<timestamp>(kept stopped for rollback), and recreated with the same image, network IP, and settings—without rebuilding VMs or touching credentials/vms/.kin-egresslifecycle is tightened so upgrades cannot silently succeed while an old helper still holds ports: processes running a deleted binary are no longer reused, orphan/stale PIDs are discovered and stopped before spawn, and listen readiness can require the new process to own the socket.Operator entry points:
scripts/migrate-legacy-cluster-slots.mjs(scoped VM IDs + concurrency), TELEMETRY docs, and stricterinstall.sh/panel-upgrade.shbehavior aroundfleet-services.mjs(install fails if refresh cannot run; panel upgrade tolerates missing helper on older images). Remote refresh now passes binary digest through migration into egress reconciliation.Reviewed by Cursor Bugbot for commit 080ddf8. Configure here.