Skip to content

Commit bfe5b99

Browse files
committed
Fix empty HOST in the generated secret
1 parent 755e512 commit bfe5b99

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

internal/controller/postgresuser_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func NewPostgresUserReconciler(mgr manager.Manager, cfg *config.Cfg, pg postgres
3939
Client: mgr.GetClient(),
4040
Scheme: mgr.GetScheme(),
4141
pg: pg,
42+
pgHost: cfg.PostgresHost,
4243
instanceFilter: cfg.AnnotationFilter,
4344
keepSecretName: cfg.KeepSecretName,
4445
}

internal/controller/postgresuser_controller_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,14 @@ var _ = Describe("PostgresUser Controller", func() {
316316
foundSecret := &corev1.Secret{}
317317
err = cl.Get(ctx, types.NamespacedName{Name: secretName + "-" + name, Namespace: namespace}, foundSecret)
318318
Expect(err).NotTo(HaveOccurred())
319-
Expect(foundSecret.Data).To(HaveKey("ROLE"))
319+
Expect(foundSecret.Data).To(HaveKey("DATABASE_NAME"))
320+
Expect(foundSecret.Data).To(HaveKey("HOST"))
321+
Expect(foundSecret.Data).To(HaveKey("LOGIN"))
320322
Expect(foundSecret.Data).To(HaveKey("PASSWORD"))
323+
Expect(foundSecret.Data).To(HaveKey("POSTGRES_DOTNET_URL"))
324+
Expect(foundSecret.Data).To(HaveKey("POSTGRES_JDBC_URL"))
321325
Expect(foundSecret.Data).To(HaveKey("POSTGRES_URL"))
326+
Expect(foundSecret.Data).To(HaveKey("ROLE"))
322327
})
323328

324329
It("should fail if the database does not exist", func() {

0 commit comments

Comments
 (0)