From 876d037aea0381accef7d836de746c4d428353cb Mon Sep 17 00:00:00 2001 From: "lemstra.b" Date: Wed, 8 Jul 2020 10:49:55 +0200 Subject: [PATCH 1/2] Added host and database_name to Kubernetes secret --- pkg/controller/postgresuser/postgresuser_controller.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/controller/postgresuser/postgresuser_controller.go b/pkg/controller/postgresuser/postgresuser_controller.go index a5ecf6b9..f9db8ed9 100644 --- a/pkg/controller/postgresuser/postgresuser_controller.go +++ b/pkg/controller/postgresuser/postgresuser_controller.go @@ -273,10 +273,12 @@ func (r *ReconcilePostgresUser) newSecretForCR(cr *dbv1alpha1.PostgresUser, role Labels: labels, }, Data: map[string][]byte{ - "POSTGRES_URL": []byte(pgUserUrl), - "ROLE": []byte(role), - "PASSWORD": []byte(password), - "LOGIN": []byte(login), + "POSTGRES_URL": []byte(pgUserUrl), + "HOST": []byte(r.pgHost), + "DATABASE_NAME": []byte(cr.Status.DatabaseName), + "ROLE": []byte(role), + "PASSWORD": []byte(password), + "LOGIN": []byte(login), }, } } From c029b62c2a02a8aeb80ad24736769a34a4701885 Mon Sep 17 00:00:00 2001 From: "lemstra.b" Date: Thu, 9 Jul 2020 07:23:16 +0200 Subject: [PATCH 2/2] Fixed indentation --- .../postgresuser/postgresuser_controller.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/controller/postgresuser/postgresuser_controller.go b/pkg/controller/postgresuser/postgresuser_controller.go index f9db8ed9..c425bf54 100644 --- a/pkg/controller/postgresuser/postgresuser_controller.go +++ b/pkg/controller/postgresuser/postgresuser_controller.go @@ -273,12 +273,12 @@ func (r *ReconcilePostgresUser) newSecretForCR(cr *dbv1alpha1.PostgresUser, role Labels: labels, }, Data: map[string][]byte{ - "POSTGRES_URL": []byte(pgUserUrl), - "HOST": []byte(r.pgHost), - "DATABASE_NAME": []byte(cr.Status.DatabaseName), - "ROLE": []byte(role), - "PASSWORD": []byte(password), - "LOGIN": []byte(login), + "POSTGRES_URL": []byte(pgUserUrl), + "HOST": []byte(r.pgHost), + "DATABASE_NAME": []byte(cr.Status.DatabaseName), + "ROLE": []byte(role), + "PASSWORD": []byte(password), + "LOGIN": []byte(login), }, } }