Skip to content

Commit

Permalink
Remove redundant params in MilvusContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
victornguen committed Oct 29, 2024
1 parent 92a74f2 commit 9dc411d
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
}
}
}
}

0 comments on commit 9dc411d

Please sign in to comment.