Cluster env variables should be reflected for StatefulSet update (#2045)

* Cluster env variables should be reflected for StatefulSet update
* Add unit test for comparing StatefulSet's
This commit is contained in:
Dmitry Volodin
2022-10-13 13:54:58 +02:00
committed by GitHub
parent 78bd4fac61
commit a85023ff10
3 changed files with 84 additions and 60 deletions
+6 -3
View File
@@ -836,9 +836,12 @@ func TestGenerateSpiloPodEnvVars(t *testing.T) {
for _, tt := range tests {
c := newMockCluster(tt.opConfig)
c.Postgresql = tt.pgsql
actualEnvs := c.generateSpiloPodEnvVars(
types.UID(dummyUUID), exampleSpiloConfig, tt.cloneDescription, tt.standbyDescription)
pgsql := tt.pgsql
pgsql.Spec.Clone = tt.cloneDescription
pgsql.Spec.StandbyCluster = tt.standbyDescription
c.Postgresql = pgsql
actualEnvs := c.generateSpiloPodEnvVars(&pgsql.Spec, types.UID(dummyUUID), exampleSpiloConfig)
for _, ev := range tt.expectedValues {
env := actualEnvs[ev.envIndex]