feat: 定义 v1alpha1 API 合同 #2

Merged
panxiao81 merged 2 commits from feature/v1alpha1-api into main 2026-09-10 08:12:44 +00:00
Owner

概要

实现 issue #1 的第一个可独立 review 切片:把已批准的 v1alpha1 API 合同落实为 Go types、CRD schema、semantic defaults 和 samples。

  • 为 Instance 增加 hostaddr、typed TLS mode、phase/status 和 OpenBao 管理凭据校验
  • 移除独立 owner role 与 Tenant 自选 OpenBao path
  • 为 Tenant 增加 typed deletion policy、phase、有效 database/login role、Secret reference 和 OpenBao URL status
  • 动态默认值由 controller helper 计算,保持 webhook-free
  • 默认 ExternalSecret/Secret 名称为 <instance>-<tenant>-postgresql,允许自定义 target Secret
  • 生成并提交 CRD 与 DeepCopy 变更,更新 samples
  • 增加 semantic default 单元测试和 envtest API/default/validation 契约测试
  • 记录本地 lint、PR CI 完整测试的验证边界

验证

  • make lint:通过
  • make test:本次切片在调整本地验证策略前运行并通过
  • git diff --check:通过
  • PR 的 self-hosted Gitea Actions 负责再次运行 Tests、Lint 和 E2E

生成文件

以下文件由 make manifests generate 生成并与 API source 同 commit 提交:

  • api/v1alpha1/zz_generated.deepcopy.go
  • config/crd/bases/database.ddupan.top_postgresqlinstances.yaml
  • config/crd/bases/database.ddupan.top_postgresqltenants.yaml

Refs #1

## 概要 实现 issue #1 的第一个可独立 review 切片:把已批准的 v1alpha1 API 合同落实为 Go types、CRD schema、semantic defaults 和 samples。 - 为 Instance 增加 `hostaddr`、typed TLS mode、phase/status 和 OpenBao 管理凭据校验 - 移除独立 owner role 与 Tenant 自选 OpenBao path - 为 Tenant 增加 typed deletion policy、phase、有效 database/login role、Secret reference 和 OpenBao URL status - 动态默认值由 controller helper 计算,保持 webhook-free - 默认 ExternalSecret/Secret 名称为 `<instance>-<tenant>-postgresql`,允许自定义 target Secret - 生成并提交 CRD 与 DeepCopy 变更,更新 samples - 增加 semantic default 单元测试和 envtest API/default/validation 契约测试 - 记录本地 lint、PR CI 完整测试的验证边界 ## 验证 - `make lint`:通过 - `make test`:本次切片在调整本地验证策略前运行并通过 - `git diff --check`:通过 - PR 的 self-hosted Gitea Actions 负责再次运行 Tests、Lint 和 E2E ## 生成文件 以下文件由 `make manifests generate` 生成并与 API source 同 commit 提交: - `api/v1alpha1/zz_generated.deepcopy.go` - `config/crd/bases/database.ddupan.top_postgresqlinstances.yaml` - `config/crd/bases/database.ddupan.top_postgresqltenants.yaml` Refs #1
panxiao81 added 2 commits 2026-09-10 07:20:12 +00:00
feat: 定义 v1alpha1 API 合同
E2E Tests / Run on Ubuntu (pull_request) Failing after 1m6s
Lint / Run on Ubuntu (pull_request) Successful in 7m7s
Tests / Run on Ubuntu (pull_request) Successful in 4m42s
1f5aa3bd2f
panxiao81 merged commit 60b63100b2 into main 2026-09-10 08:12:44 +00:00
panxiao81 deleted branch feature/v1alpha1-api 2026-09-10 08:13:49 +00:00
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/postgresql-tenant-operator#2