introduce PGVERSION
This commit is contained in:
parent
692c721854
commit
1386b1f7c8
|
|
@ -294,7 +294,6 @@ PatroniInitDBParams:
|
||||||
}
|
}
|
||||||
|
|
||||||
config.PgLocalConfiguration = make(map[string]interface{})
|
config.PgLocalConfiguration = make(map[string]interface{})
|
||||||
config.PgLocalConfiguration[patroniPGBinariesParameterName] = fmt.Sprintf(pgBinariesLocationTemplate, pg.PgVersion)
|
|
||||||
if len(pg.Parameters) > 0 {
|
if len(pg.Parameters) > 0 {
|
||||||
local, bootstrap := getLocalAndBoostrapPostgreSQLParameters(pg.Parameters)
|
local, bootstrap := getLocalAndBoostrapPostgreSQLParameters(pg.Parameters)
|
||||||
|
|
||||||
|
|
@ -650,6 +649,10 @@ 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{
|
||||||
|
|
|
||||||
|
|
@ -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: `{"postgresql":{"bin_dir":"/usr/lib/postgresql/9.6/bin"},"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{}}}`,
|
result: `{"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{}}}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
subtest: "Patroni configured",
|
subtest: "Patroni configured",
|
||||||
|
|
@ -89,7 +89,7 @@ func TestGenerateSpiloJSONConfiguration(t *testing.T) {
|
||||||
},
|
},
|
||||||
role: "zalandos",
|
role: "zalandos",
|
||||||
opConfig: config.Config{},
|
opConfig: config.Config{},
|
||||||
result: `{"postgresql":{"bin_dir":"/usr/lib/postgresql/11/bin","pg_hba":["hostssl all all 0.0.0.0/0 md5","host all all 0.0.0.0/0 md5"]},"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"},"data-checksums",{"encoding":"UTF8"},{"locale":"en_US.UTF-8"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{"ttl":30,"loop_wait":10,"retry_timeout":10,"maximum_lag_on_failover":33554432,"synchronous_mode":true,"synchronous_mode_strict":true,"slots":{"permanent_logical_1":{"database":"foo","plugin":"pgoutput","type":"logical"}}}}}`,
|
result: `{"postgresql":{"pg_hba":["hostssl all all 0.0.0.0/0 md5","host all all 0.0.0.0/0 md5"]},"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"},"data-checksums",{"encoding":"UTF8"},{"locale":"en_US.UTF-8"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{"ttl":30,"loop_wait":10,"retry_timeout":10,"maximum_lag_on_failover":33554432,"synchronous_mode":true,"synchronous_mode_strict":true,"slots":{"permanent_logical_1":{"database":"foo","plugin":"pgoutput","type":"logical"}}}}}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue