Skip to content

Commit 1ed14e1

Browse files
committed
add test that should fail
1 parent 1b8299c commit 1ed14e1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

internal/controller/postgrescluster/pgbouncer_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,24 @@ topologySpreadConstraints:
509509
assert.Assert(t, deploy.Spec.Template.Spec.TopologySpreadConstraints == nil)
510510
})
511511
})
512+
513+
t.Run("PodSpecWithAdditionalVolumes", func(t *testing.T) {
514+
assert.Assert(t, false)
515+
516+
cluster := cluster.DeepCopy()
517+
cluster.Spec.Proxy.PGBouncer.Additional = []v1beta1.AdditionalVolume{{
518+
ClaimName: "required",
519+
Name: "required",
520+
}}
521+
522+
deploy, specified, err := reconciler.generatePGBouncerDeployment(
523+
ctx, cluster, primary, configmap, secret)
524+
525+
assert.NilError(t, err)
526+
assert.Assert(t, specified)
527+
528+
assert.Assert(t, cmp.MarshalMatches(deploy.Spec.Template.Spec.Containers, `whoops`))
529+
})
512530
}
513531

514532
func TestReconcilePGBouncerDisruptionBudget(t *testing.T) {

0 commit comments

Comments
 (0)