refactor: 集中显式注入并归位凭据领域规则 #15

Open
panxiao81 wants to merge 1 commits from refactor/database-domain-di into main
Owner

范围

承接已合并的 #14,仅重构依赖装配与领域边界,不增加业务功能。

  • bootstrap 集中手写 Wire 风格的构造器注入;不引入 IoC 容器、Wire 生成器或新依赖。
  • 三个 controller 接收已装配用例,Reconcile/SetupWithManager 不再构造 adapter 或用例。
  • 凭据值对象、准备资格、固定位置与不确定创建恢复规则归入 domain/credential。
  • application 保留 I/O 编排、消费方接口与并发快照;Kubernetes adapter 映射领域阶段到现有 Conditions。
  • 补充注入身份、依赖边界和领域规则测试;更新架构说明。

兼容边界

API/CRD、凭据七字段、CAS=0、冲突处理、重试和连接关闭顺序保持不变。未增加 PostgreSQL 建库、ESO 或删除流程。

验证

  • make test、make build
  • make test-database-integration(真实 Kubernetes API、PostgreSQL、OpenBao)
  • 领域/application/bootstrap race 测试
  • 普通及 integration 标签 lint 均 0 issues
  • 文档检查、git diff --check

Review 入口

依次查看 internal/bootstrap/database_wiring.go、internal/database/domain/credential/preparation.go、internal/database/application/credential_preparation.go。

对应 wiki 分层约定在本轮同步到 architecture/ayatori-control-plane.md。

## 范围 承接已合并的 #14,仅重构依赖装配与领域边界,不增加业务功能。 - bootstrap 集中手写 Wire 风格的构造器注入;不引入 IoC 容器、Wire 生成器或新依赖。 - 三个 controller 接收已装配用例,Reconcile/SetupWithManager 不再构造 adapter 或用例。 - 凭据值对象、准备资格、固定位置与不确定创建恢复规则归入 domain/credential。 - application 保留 I/O 编排、消费方接口与并发快照;Kubernetes adapter 映射领域阶段到现有 Conditions。 - 补充注入身份、依赖边界和领域规则测试;更新架构说明。 ## 兼容边界 API/CRD、凭据七字段、CAS=0、冲突处理、重试和连接关闭顺序保持不变。未增加 PostgreSQL 建库、ESO 或删除流程。 ## 验证 - make test、make build - make test-database-integration(真实 Kubernetes API、PostgreSQL、OpenBao) - 领域/application/bootstrap race 测试 - 普通及 integration 标签 lint 均 0 issues - 文档检查、git diff --check ## Review 入口 依次查看 internal/bootstrap/database_wiring.go、internal/database/domain/credential/preparation.go、internal/database/application/credential_preparation.go。 对应 wiki 分层约定在本轮同步到 architecture/ayatori-control-plane.md。
panxiao81 added 1 commit 2026-09-27 19:17:17 +00:00
refactor: 集中显式注入并归位凭据领域规则
Verify / test (pull_request) Successful in 13m29s
Verify / lint (pull_request) Successful in 14m13s
Verify / database-integration (pull_request) Successful in 15m48s
7834cab97f
All checks were successful
Verify / test (pull_request) Successful in 13m29s
Verify / lint (pull_request) Successful in 14m13s
Verify / database-integration (pull_request) Successful in 15m48s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin refactor/database-domain-di:refactor/database-domain-di
git checkout refactor/database-domain-di
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: panxiao81/ayatori#15