Skip to content

Commit ad6fdb8

Browse files
committed
fix(redis): test double ipam
1 parent 91870a8 commit ad6fdb8

3 files changed

Lines changed: 557 additions & 143 deletions

File tree

internal/namespaces/redis/v1/custom_cluster.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ func clusterCreateBuilder(c *core.Command) *core.Command {
7373
continue
7474
}
7575
ipamConfig := &redis.EndpointSpecPrivateNetworkSpecIpamConfig{}
76-
if !customEndpoint.PrivateNetwork.EnableIpam {
76+
if !customEndpoint.PrivateNetwork.EnableIpam ||
77+
len(customEndpoint.PrivateNetwork.ServiceIPs) > 0 {
7778
ipamConfig = nil
7879
}
7980
createClusterRequest.Endpoints = append(

internal/namespaces/redis/v1/custom_cluster_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ func Test_IpamConfig(t *testing.T) {
199199
core.TestCheckGolden(),
200200
func(t *testing.T, ctx *core.CheckFuncCtx) {
201201
t.Helper()
202+
require.NotNil(t, ctx.Result, "Result should not be nil")
202203
endpoints := ctx.Result.(*redisSDK.Cluster).Endpoints
203204
checkEndpoints(t, endpoints, 0, 1, 1)
204205
},

0 commit comments

Comments
 (0)