Skip to content

Commit de1194e

Browse files
committed
e2e: run DeployCacheServerWithExternalEtcd with two cache-server replicas
1 parent f0bb912 commit de1194e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

test/e2e/cacheserver/cacheserver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func TestCacheWithExternalEtcdAndRootShard(t *testing.T) {
111111
namespace := utils.CreateSelfDestructingNamespace(t, ctx, client, "cache-with-etcd-rootshard")
112112

113113
// deploy the cache server
114-
cacheServer := utils.DeployCacheServerWithExternalEtcd(ctx, t, client, namespace.Name)
114+
cacheServer := utils.DeployCacheServerWithExternalEtcd(ctx, t, client, namespace.Name, 2)
115115

116116
// deploy a root shard that uses our cache
117117
rootShard := utils.DeployRootShard(ctx, t, client, namespace.Name, "example.localhost", func(rs *operatorv1alpha1.RootShard) {

test/utils/deploy.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,18 @@ func DeployCacheServer(ctx context.Context, t *testing.T, client ctrlruntimeclie
285285
return server
286286
}
287287

288-
func DeployCacheServerWithExternalEtcd(ctx context.Context, t *testing.T, client ctrlruntimeclient.Client, namespace string, patches ...func(*operatorv1alpha1.CacheServer)) operatorv1alpha1.CacheServer {
288+
func DeployCacheServerWithExternalEtcd(ctx context.Context, t *testing.T, client ctrlruntimeclient.Client, namespace string, replicas int32, patches ...func(*operatorv1alpha1.CacheServer)) operatorv1alpha1.CacheServer {
289289
t.Helper()
290290

291291
etcd := DeployEtcd(t, "kachy-etcd", namespace)
292292

293+
if replicas < 1 {
294+
replicas = 1
295+
}
296+
293297
return DeployCacheServer(ctx, t, client, namespace, append(patches, func(server *operatorv1alpha1.CacheServer) {
298+
server.Spec.Replicas = &replicas
299+
294300
server.Spec.Etcd = &operatorv1alpha1.EtcdConfig{
295301
Endpoints: []string{etcd},
296302
}

0 commit comments

Comments
 (0)