Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant params in MilvusContainer #375

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}
}
}
Loading