From 9dc411d5df9bacd7fa9fe2ba16717a76cc735af6 Mon Sep 17 00:00:00 2001 From: Victor Nguen Date: Wed, 30 Oct 2024 00:21:36 +0300 Subject: [PATCH] Remove redundant params in MilvusContainer --- .../testcontainers/MilvusContainer.scala | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/modules/milvus/src/main/scala/com/dimafeng/testcontainers/MilvusContainer.scala b/modules/milvus/src/main/scala/com/dimafeng/testcontainers/MilvusContainer.scala index 90ff6a2..576b02d 100644 --- a/modules/milvus/src/main/scala/com/dimafeng/testcontainers/MilvusContainer.scala +++ b/modules/milvus/src/main/scala/com/dimafeng/testcontainers/MilvusContainer.scala @@ -4,14 +4,12 @@ import org.testcontainers.milvus.{MilvusContainer => JavaMilvusIOContainer} import org.testcontainers.utility.DockerImageName case class MilvusContainer( - dockerImageName: DockerImageName = DockerImageName.parse(MilvusContainer.defaultDockerImageName), - httpPort: Int = MilvusContainer.defaultPort, - etcdEndpoint: Option[String] = None + dockerImageName: DockerImageName = DockerImageName.parse(MilvusContainer.defaultDockerImageName), + etcdEndpoint: Option[String] = None ) extends SingleContainer[JavaMilvusIOContainer] { override val container: JavaMilvusIOContainer = { val c = new JavaMilvusIOContainer(dockerImageName) - c.withExposedPorts(httpPort, MilvusContainer.managementPort) etcdEndpoint.foreach(c.withEtcdEndpoint) c } @@ -21,19 +19,18 @@ case class MilvusContainer( object MilvusContainer { - val defaultImage = "milvusdb/milvus" - val defaultTag = "v2.4.4" + val defaultImage = "milvusdb/milvus" + val defaultTag = "v2.4.4" val defaultDockerImageName = s"$defaultImage:$defaultTag" - val defaultPort = 19530 - val managementPort = 9091 - - case class Def(dockerImageName: DockerImageName = DockerImageName.parse(MilvusContainer.defaultDockerImageName), - port: Int = MilvusContainer.defaultPort) extends ContainerDef { + case class Def( + dockerImageName: DockerImageName = DockerImageName.parse(MilvusContainer.defaultDockerImageName), + etcdEndpoint: Option[String] = None + ) extends ContainerDef { override type Container = MilvusContainer override def createContainer(): MilvusContainer = { - new MilvusContainer(dockerImageName, port) + new MilvusContainer(dockerImageName, etcdEndpoint) } } -} \ No newline at end of file +}