From ab3e7708a57242178c8e2291acbef79eb71e13e9 Mon Sep 17 00:00:00 2001 From: Aaron Kuehler Date: Fri, 17 Nov 2023 13:11:39 -0500 Subject: [PATCH] Fix generated mocks and integration tests --- mocks/service/k8s/Services.go | 5 +++++ test/integration/redisfailover/creation_test.go | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mocks/service/k8s/Services.go b/mocks/service/k8s/Services.go index 71f614a91..19175eacf 100644 --- a/mocks/service/k8s/Services.go +++ b/mocks/service/k8s/Services.go @@ -12,6 +12,7 @@ import ( mock "github.com/stretchr/testify/mock" networkingv1 "k8s.io/api/networking/v1" + policyv1 "k8s.io/api/policy/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -553,6 +554,10 @@ func (_m *Services) GetPodDisruptionBudget(namespace string, name string) (*poli ret := _m.Called(namespace, name) var r0 *policyv1.PodDisruptionBudget + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (*policyv1.PodDisruptionBudget, error)); ok { + return rf(namespace, name) + } if rf, ok := ret.Get(0).(func(string, string) *policyv1.PodDisruptionBudget); ok { r0 = rf(namespace, name) } else { diff --git a/test/integration/redisfailover/creation_test.go b/test/integration/redisfailover/creation_test.go index 8e8c0750a..143e03495 100644 --- a/test/integration/redisfailover/creation_test.go +++ b/test/integration/redisfailover/creation_test.go @@ -161,6 +161,8 @@ func TestRedisFailover(t *testing.T) { t.Run("Check Sentinels Checking the Redis Master", clients.testSentinelMonitoring) } +const sentinelPort = 26379 + func (c *clients) testCRCreation(t *testing.T) { assert := assert.New(t) toCreate := &redisfailoverv1.RedisFailover{ @@ -178,7 +180,7 @@ func (c *clients) testCRCreation(t *testing.T) { }, Sentinel: redisfailoverv1.SentinelSettings{ Replicas: sentinelSize, - Port: redisfailoverv1.Port(26379), + Port: redisfailoverv1.Port(sentinelPort), }, Auth: redisfailoverv1.AuthSettings{ SecretPath: authSecretPath, @@ -247,7 +249,7 @@ func (c *clients) testSentinelMonitoring(t *testing.T) { for _, pod := range sentinelPodList.Items { ip := pod.Status.PodIP - master, _, _ := c.redisClient.GetSentinelMonitor(ip) + master, _, _ := c.redisClient.GetSentinelMonitor(ip, sentinelPort) masters = append(masters, master) }