Skip to content

Commit c88bbe6

Browse files
Correct the assert with the list of constraints.
1 parent 7773301 commit c88bbe6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pkg/cluster/k8sres_test.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -3930,12 +3930,14 @@ func TestTopologySpreadConstraints(t *testing.T) {
39303930

39313931
s, err := cluster.generateStatefulSet(&pg.Spec)
39323932
assert.NoError(t, err)
3933-
assert.Contains(t, s.Spec.Template.Spec.TopologySpreadConstraints, v1.TopologySpreadConstraint{
3934-
MaxSkew: int32(1),
3935-
TopologyKey: "topology.kubernetes.io/zone",
3936-
WhenUnsatisfiable: v1.DoNotSchedule,
3937-
LabelSelector: &metav1.LabelSelector{
3938-
MatchLabels: cluster.labelsSet(true),
3933+
assert.Contains(t, s.Spec.Template.Spec.TopologySpreadConstraints, []v1.TopologySpreadConstraint{
3934+
{
3935+
MaxSkew: int32(1),
3936+
TopologyKey: "topology.kubernetes.io/zone",
3937+
WhenUnsatisfiable: v1.DoNotSchedule,
3938+
LabelSelector: &metav1.LabelSelector{
3939+
MatchLabels: cluster.labelsSet(true),
3940+
},
39393941
},
39403942
})
39413943
}

0 commit comments

Comments
 (0)