fix TestGenerateSpiloJSONConfiguration

This commit is contained in:
Sergey Dudoladov 2020-10-14 07:27:33 +02:00
parent 1386b1f7c8
commit 1a4357ad8f
2 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -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",