From 1a4357ad8f32b560399caa43caff16e985e41afb Mon Sep 17 00:00:00 2001 From: Sergey Dudoladov Date: Wed, 14 Oct 2020 07:27:33 +0200 Subject: [PATCH] fix TestGenerateSpiloJSONConfiguration --- pkg/cluster/k8sres.go | 8 ++++---- pkg/cluster/k8sres_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index 1c873bc8f..ed5efaf84 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -649,10 +649,6 @@ func (c *Cluster) generateSpiloPodEnvVars(uid types.UID, spiloConfiguration stri Name: "PGROOT", Value: constants.PostgresDataPath, }, - { - Name: "PGVERSION", - Value: c.Spec.PgVersion, - }, { Name: "POD_IP", ValueFrom: &v1.EnvVarSource{ @@ -717,6 +713,10 @@ func (c *Cluster) generateSpiloPodEnvVars(uid types.UID, spiloConfiguration stri Name: "HUMAN_ROLE", Value: c.OpConfig.PamRoleName, }, + { + Name: "PGVERSION", + Value: c.Spec.PgVersion, + }, } // Spilo expects cluster labels as JSON if clusterLabels, err := json.Marshal(labels.Set(c.OpConfig.ClusterLabels)); err != nil { diff --git a/pkg/cluster/k8sres_test.go b/pkg/cluster/k8sres_test.go index 9f3cf1f7d..c179cba0b 100644 --- a/pkg/cluster/k8sres_test.go +++ b/pkg/cluster/k8sres_test.go @@ -67,7 +67,7 @@ func TestGenerateSpiloJSONConfiguration(t *testing.T) { patroni: &acidv1.Patroni{}, role: "zalandos", opConfig: config.Config{}, - result: `{"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{}}}`, + result: `{"postgresql":{},"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{}}}`, }, { subtest: "Patroni configured",