File tree Expand file tree Collapse file tree
src/it/java/io/weaviate/containers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,21 @@ public class Weaviate extends WeaviateContainer {
2828 private volatile SharedClient clientInstance ;
2929 private final String containerName ;
3030
31+ /**
32+ * By default, testcontainer's name is only available after calling
33+ * {@link #start}.
34+ * We need to know each container's name in advance to run a cluster
35+ * of several nodes, in which case we alse set the name manually.
36+ *
37+ * @see Builder#build()
38+ */
39+ @ Override
40+ public String getContainerName () {
41+ return containerName != null
42+ ? containerName
43+ : super .getContainerName ();
44+ }
45+
3146 /**
3247 * Create a new instance of WeaviateClient connected to this container if none
3348 * exist. Get an existing client otherwise.
@@ -230,7 +245,7 @@ public Weaviate build() {
230245 }
231246
232247 environment .forEach ((name , value ) -> c .withEnv (name , value ));
233- c .withCreateContainerCmdModifier (cmd -> cmd .withName ( containerName ). withHostName (containerName ));
248+ c .withCreateContainerCmdModifier (cmd -> cmd .withHostName (containerName ));
234249 return c ;
235250 }
236251 }
You can’t perform that action at this time.
0 commit comments