fix TestGenerateSpiloJSONConfiguration
This commit is contained in:
parent
1386b1f7c8
commit
1a4357ad8f
|
|
@ -649,10 +649,6 @@ func (c *Cluster) generateSpiloPodEnvVars(uid types.UID, spiloConfiguration stri
|
||||||
Name: "PGROOT",
|
Name: "PGROOT",
|
||||||
Value: constants.PostgresDataPath,
|
Value: constants.PostgresDataPath,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "PGVERSION",
|
|
||||||
Value: c.Spec.PgVersion,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "POD_IP",
|
Name: "POD_IP",
|
||||||
ValueFrom: &v1.EnvVarSource{
|
ValueFrom: &v1.EnvVarSource{
|
||||||
|
|
@ -717,6 +713,10 @@ func (c *Cluster) generateSpiloPodEnvVars(uid types.UID, spiloConfiguration stri
|
||||||
Name: "HUMAN_ROLE",
|
Name: "HUMAN_ROLE",
|
||||||
Value: c.OpConfig.PamRoleName,
|
Value: c.OpConfig.PamRoleName,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "PGVERSION",
|
||||||
|
Value: c.Spec.PgVersion,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
// Spilo expects cluster labels as JSON
|
// Spilo expects cluster labels as JSON
|
||||||
if clusterLabels, err := json.Marshal(labels.Set(c.OpConfig.ClusterLabels)); err != nil {
|
if clusterLabels, err := json.Marshal(labels.Set(c.OpConfig.ClusterLabels)); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ func TestGenerateSpiloJSONConfiguration(t *testing.T) {
|
||||||
patroni: &acidv1.Patroni{},
|
patroni: &acidv1.Patroni{},
|
||||||
role: "zalandos",
|
role: "zalandos",
|
||||||
opConfig: config.Config{},
|
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",
|
subtest: "Patroni configured",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue