Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
inelpandzic committed Oct 13, 2023
1 parent 24f9d6d commit 5d4194c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions percona/controller/pgcluster/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,15 @@ var _ = Describe("Services with LoadBalancerSourceRanges", Ordered, func() {
})

It("should create PerconaPGCluster with service exposed with loadBalancerSourceRanges", func() {
cr.Spec.Expose.LoadBalancerSourceRanges = []string{"10.10.10.10/16"}
cr.Spec.PgBouncer.Expose.LoadBalancerSourceRanges = []string{"10.10.11.11./16"}
cr.Spec.Expose = &v2.ServiceExpose{
LoadBalancerSourceRanges = []string{"10.10.10.10/16"}

Check failure on line 835 in percona/controller/pgcluster/controller_test.go

View workflow job for this annotation

GitHub Actions / Test

expected '==', found '='

Check failure on line 835 in percona/controller/pgcluster/controller_test.go

View workflow job for this annotation

GitHub Actions / runner / suggester / golangci-lint

expected '==', found '=' (typecheck)
}
cr.Spec.Proxy = &v2.PGProxySpec{
PGBouncer: &v2.PGBouncerSpec{
ServiceExpose: &v2.ServiceExpose{
LoadBalancerSourceRanges: []string{"10.10.11.11./16"},
}

Check failure on line 841 in percona/controller/pgcluster/controller_test.go

View workflow job for this annotation

GitHub Actions / runner / suggester / golangci-lint

missing ',' before newline in composite literal (typecheck)
}

Check failure on line 842 in percona/controller/pgcluster/controller_test.go

View workflow job for this annotation

GitHub Actions / runner / suggester / golangci-lint

missing ',' before newline in composite literal (typecheck)
Expect(k8sClient.Create(ctx, cr)).Should(Succeed())

Check failure on line 843 in percona/controller/pgcluster/controller_test.go

View workflow job for this annotation

GitHub Actions / runner / suggester / golangci-lint

missing ',' before newline in composite literal (typecheck)
})

Check failure on line 844 in percona/controller/pgcluster/controller_test.go

View workflow job for this annotation

GitHub Actions / runner / suggester / golangci-lint

expected statement, found ')' (typecheck)

Expand All @@ -847,11 +854,11 @@ var _ = Describe("Services with LoadBalancerSourceRanges", Ordered, func() {
haService := &corev1.Service{}
err := k8sClient.Get(ctx, types.NamespacedName{Namespace: cr.Namespace, Name: cr.Name + "-ha"}, haService)
Expect(err).NotTo(HaveOccurred())
Expect(haServiceSpec.LoadBalancerSourceRanges).To(Equal(cr.Spec.Expose.LoadBalancerSourceRanges))
Expect(haService.Spec.LoadBalancerSourceRanges).To(Equal(cr.Spec.Expose.LoadBalancerSourceRanges))

pgbService := &corev1.Service{}
err := k8sClient.Get(ctx, types.NamespacedName{Namespace: cr.Namespace, Name: cr.Name + "-pgbouncer"}, pgbService)
err = k8sClient.Get(ctx, types.NamespacedName{Namespace: cr.Namespace, Name: cr.Name + "-pgbouncer"}, pgbService)
Expect(err).NotTo(HaveOccurred())
Expect(pgbService.Spec.LoadBalancerSourceRanges).To(Equal(cr.Spec.PgBouncer.Expose.LoadBalancerSourceRanges))
Expect(pgbService.Spec.LoadBalancerSourceRanges).To(Equal(cr.Spec.Proxy.PGBouncer.ServiceExpose.LoadBalancerSourceRanges))
})
})

Check failure on line 864 in percona/controller/pgcluster/controller_test.go

View workflow job for this annotation

GitHub Actions / runner / suggester / golangci-lint

expected '}', found 'EOF' (typecheck)

0 comments on commit 5d4194c

Please sign in to comment.