Skip to content

Commit 7edaeb7

Browse files
committed
fix unit test internal/controller/postgrescluster/pgbouncer_test.go
1 parent b59a582 commit 7edaeb7

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

internal/controller/postgrescluster/pgbouncer_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,35 +222,35 @@ ownerReferences:
222222
}{
223223
{Description: "ClusterIP with Port 32000", Type: "ClusterIP",
224224
NodePort: initialize.Int32(32000), Expect: func(t testing.TB, service *corev1.Service, err error) {
225-
assert.ErrorContains(t, err, "NodePort cannot be set with type ClusterIP on Service \"pg7-pgbouncer\"")
226-
assert.Assert(t, service == nil)
227-
}},
225+
assert.ErrorContains(t, err, "NodePort cannot be set with type ClusterIP on Service \"pg7-pgbouncer\"")
226+
assert.Assert(t, service == nil)
227+
}},
228228
{Description: "NodePort with Port 32001", Type: "NodePort",
229229
NodePort: initialize.Int32(32001), Expect: func(t testing.TB, service *corev1.Service, err error) {
230-
assert.NilError(t, err)
231-
assert.Equal(t, service.Spec.Type, corev1.ServiceTypeNodePort)
232-
alwaysExpect(t, service)
233-
assert.Assert(t, cmp.MarshalMatches(service.Spec.Ports, `
230+
assert.NilError(t, err)
231+
assert.Equal(t, service.Spec.Type, corev1.ServiceTypeNodePort)
232+
alwaysExpect(t, service)
233+
assert.Assert(t, cmp.MarshalMatches(service.Spec.Ports, `
234234
- name: pgbouncer
235235
nodePort: 32001
236236
port: 9651
237237
protocol: TCP
238238
targetPort: pgbouncer
239239
`))
240-
}},
240+
}},
241241
{Description: "LoadBalancer with Port 32002", Type: "LoadBalancer",
242242
NodePort: initialize.Int32(32002), Expect: func(t testing.TB, service *corev1.Service, err error) {
243-
assert.NilError(t, err)
244-
assert.Equal(t, service.Spec.Type, corev1.ServiceTypeLoadBalancer)
245-
alwaysExpect(t, service)
246-
assert.Assert(t, cmp.MarshalMatches(service.Spec.Ports, `
243+
assert.NilError(t, err)
244+
assert.Equal(t, service.Spec.Type, corev1.ServiceTypeLoadBalancer)
245+
alwaysExpect(t, service)
246+
assert.Assert(t, cmp.MarshalMatches(service.Spec.Ports, `
247247
- name: pgbouncer
248248
nodePort: 32002
249249
port: 9651
250250
protocol: TCP
251251
targetPort: pgbouncer
252252
`))
253-
}},
253+
}},
254254
}
255255

256256
for _, test := range typesAndPort {
@@ -384,7 +384,7 @@ func TestGeneratePGBouncerDeployment(t *testing.T) {
384384
cluster.Namespace = "ns3"
385385
cluster.Name = "test-cluster"
386386
cluster.Labels = map[string]string{
387-
naming.LabelVersion: "2.3.0",
387+
naming.LabelVersion: "2.7.0",
388388
}
389389

390390
t.Run("Unspecified", func(t *testing.T) {

0 commit comments

Comments
 (0)