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

This commit is contained in:
2026-09-10 06:25:34 +00:00
parent b443d78d14
commit 1f5aa3bd2f
13 changed files with 630 additions and 137 deletions
@@ -33,15 +33,13 @@ import (
var _ = Describe("PostgreSQLInstance Controller", func() {
Context("When reconciling a resource", func() {
const (
resourceName = "test-resource"
resourceNamespace = "default"
resourceName = "test-resource"
)
ctx := context.Background()
typeNamespacedName := types.NamespacedName{
Name: resourceName,
Namespace: resourceNamespace,
Name: resourceName,
}
postgresqlinstance := &databasev1alpha1.PostgreSQLInstance{}
@@ -51,10 +49,17 @@ var _ = Describe("PostgreSQLInstance Controller", func() {
if err != nil && errors.IsNotFound(err) {
resource := &databasev1alpha1.PostgreSQLInstance{
ObjectMeta: metav1.ObjectMeta{
Name: resourceName,
Namespace: resourceNamespace,
Name: resourceName,
},
Spec: databasev1alpha1.PostgreSQLInstanceSpec{
Endpoint: databasev1alpha1.PostgreSQLEndpoint{
Host: testPostgreSQLHost,
HostAddr: "192.0.2.10",
},
AdminCredentialRef: databasev1alpha1.OpenBaoSecretReference{
Path: "infrastructure/postgresql/admin",
},
},
// TODO(user): Specify other spec details if needed.
}
Expect(k8sClient.Create(ctx, resource)).To(Succeed())
}