From d96395e5da4384229e78f47b98d27d7e91f76165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 21 Feb 2024 12:52:42 +0100 Subject: [PATCH] chore(milvus): embed etcd should use default ports --- modules/milvus/milvus.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/modules/milvus/milvus.go b/modules/milvus/milvus.go index f788ea5497..5f64021a93 100644 --- a/modules/milvus/milvus.go +++ b/modules/milvus/milvus.go @@ -57,7 +57,6 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize // Otherwise the milvus container will panic on startup. createDefaultEmbedEtcdConfig, }, - PostStarts: []testcontainers.ContainerHook{regenerateEmbedEtcdConfig}, }, }, } @@ -129,23 +128,3 @@ func createDefaultEmbedEtcdConfig(ctx context.Context, c testcontainers.Containe return nil } - -// regenerateEmbedEtcdConfig updates the embed etcd config file with the mapped port -func regenerateEmbedEtcdConfig(ctx context.Context, c testcontainers.Container) error { - containerPort, err := c.MappedPort(ctx, "2379/tcp") - if err != nil { - return fmt.Errorf("failed to get mapped port: %w", err) - } - - embedEtcdConfig, err := renderEmbedEtcdConfig(containerPort.Int()) - if err != nil { - return fmt.Errorf("failed to embed etcd config: %w", err) - } - - err = c.CopyToContainer(ctx, embedEtcdConfig, embedEtcdContainerPath, 600) - if err != nil { - return fmt.Errorf("failed to copy embedEtcd.yaml into container: %w", err) - } - - return nil -}