envoy-control icon indicating copy to clipboard operation
envoy-control copied to clipboard

Replace portBindings.add with standard way of exposing ports

Open slonka opened this issue 5 years ago • 5 comments

How to expose ports: https://www.testcontainers.org/features/networking/#exposing-container-ports-to-the-host

Where to fix: https://github.com/allegro/envoy-control/blob/b74ba3c64f1ea30dd531f8bb98086e7f4b4f6e1d/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/config/consul/ConsulContainer.kt#L30

slonka avatar Apr 17 '20 07:04 slonka

I'd like to take this one

Kornelos avatar Oct 15 '20 08:10 Kornelos

I've assigned you. Have fun :)

pzmi avatar Oct 15 '20 08:10 pzmi

Unfortunately container.getMappedPort() works only after starting containers. Test classes logic relies on fetching the port number before starting container, so in my opinion current implementation is justified.

Kornelos avatar Oct 15 '20 11:10 Kornelos

I think @slonka had in mind using .withExposedPorts(8080, 8081) instead of portBindings.add("$externalPort:$internalPort")

pzmi avatar Oct 23 '20 14:10 pzmi