Skip to content

Commit 4901e18

Browse files
committed
Fix test
1 parent a7ea055 commit 4901e18

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

internal/controller/postgrescluster/util_test.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,17 @@ func TestAddAdditionalVolumesToSpecifiedContainers(t *testing.T) {
573573
assert.Assert(t, cmp.MarshalMatches(
574574
copyPodTemplate.Spec.Volumes,
575575
tc.expectedVolumes))
576-
assert.Assert(t, cmp.DeepEqual(
577-
missingContainers,
578-
tc.expectedMissing))
576+
if len(tc.expectedMissing) == 0 {
577+
assert.Assert(t, cmp.DeepEqual(
578+
missingContainers,
579+
tc.expectedMissing))
580+
} else {
581+
for _, mc := range tc.expectedMissing {
582+
assert.Assert(t, cmp.Contains(
583+
missingContainers,
584+
mc))
585+
}
586+
}
579587
})
580588
}
581589
}

0 commit comments

Comments
 (0)