refactor: 按职责拆分 controller 启动流程
Verify / test (pull_request) Successful in 9m48s
Verify / lint (pull_request) Successful in 10m42s
Verify / database-integration (pull_request) Successful in 12m1s

This commit is contained in:
2026-09-27 17:37:45 +00:00
parent c7b80890fb
commit 356e21686f
8 changed files with 425 additions and 188 deletions
+6
View File
@@ -50,6 +50,12 @@ Proxmox 作为稀缺物理基础设施可以共享,通过 pool、tag、token
不在 `cmd` 平铺组件装配文件,也不为每个领域生成独立二进制。
Makefile 与 Dockerfile 均继续构建 `cmd/main.go`。
`Run` 只编排解析配置、创建 manager、显式装配组件、启动与退出清理。
`options.go` 组织配置和通用 flags;`manager.go` 处理 scheme、metrics、webhook、TLS 与探针;
`database.go`、`openbao.go` 各自维护组件参数及装配细节。新增组件不向 `Run` 堆叠参数和内部
条件分支,也不为此引入插件注册框架。组件启动失败时释放已装配资源,正常退出则先停止
manager worker,再释放连接。
基础设施能力属于整个 controller-manager,不因首个消费者是 Database 就归入该领域。
`internal/infra/openbao` 管理官方 SDK client 的 TLS 配置、Kubernetes 认证及 token 生命周期,
不依赖 Database 或其他产品领域。Bao client 默认禁用自动重试,写入结果不确定时由用例处理;