fix(opensearch): address spawned domain containers by IP, not name (#2746)

Container-name DNS only resolves on a user-defined Docker network, and
nothing guarantees the spawned OpenSearch container and floci land on one
together; on the default bridge the name-based endpoint and readiness URL
never resolve. Address the container via its resolved IP (EndpointInfo),
the pattern Neptune/MemoryDB/RDS already use, probe readiness through the
stored endpoint, and bind a host port only when running outside a
container (releasing it if the start fails).
This commit is contained in:
lex00 authored and GitHub committed 2026-08-29 23:45:38 -04:00
1 parent 895b59f1ee
commit fcc606799c
2 files changed
+41 -16

No files matched your search

@@ -50,7 +50,8 @@ class OpenSearchDomainManagerTest {
ContainerLifecycleManager lifecycleManager = mock(ContainerLifecycleManager.class);
when(lifecycleManager.createAndStart(any())).thenReturn(
new ContainerLifecycleManager.ContainerInfo("container-id", Map.of()));
new ContainerLifecycleManager.ContainerInfo("container-id", Map.of(
9200, new ContainerLifecycleManager.EndpointInfo("172.17.0.5", 9200))));
ContainerBuilder containerBuilder = mock(ContainerBuilder.class);
ContainerBuilder.Builder builder = mock(ContainerBuilder.Builder.class, RETURNS_SELF);