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

Fix KafkaContainer with multiple networks defined #4213

Merged
merged 2 commits into from
Jun 30, 2021
Merged

Fix KafkaContainer with multiple networks defined #4213

merged 2 commits into from
Jun 30, 2021

Conversation

DennisFederico
Copy link
Contributor

Current implementation exposes only two listeners PLAINTEXT and BROKER.
BROKER must be advertised to the explicitly specified network or bridge.
When a host port is exposed using Testcontainers.exposeHostPorts and a network is specified, the current implementation iterates through both network (specified and proxy container), incorrectly creating two listener with the same name "BROKER"

…R.BROKER must be advertised to explicitly specified network or bridge. If a host port is exposed using Testcontainers.exposeHostPorts and a network is specified, the container will be "attached" to an additional network, creating to listeners with the same name

Configure the BROKER listener using the network specified (withNetwork) or "bridge" if not specified, instead of iterating over all the networks in the container info. Additional test cases when a port of the host is exposed (proxy container started) and a external network is specified to the container placing multiple network entries in the container info, making additional Kafka Broker listener entries with the same name "BROKER"
@bsideup bsideup changed the title Edge case fix to AdvertisedListeners when a network is specified and a host port is exposed Fix KafkaContainer with multiple networks defined Jun 30, 2021
@bsideup bsideup added this to the next milestone Jun 30, 2021
@bsideup bsideup merged commit adae983 into testcontainers:master Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants