Skip to content

Additional ports mapping #65

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

Closed
bitgorbovsky opened this issue Feb 10, 2023 · 1 comment · Fixed by #76
Closed

Additional ports mapping #65

bitgorbovsky opened this issue Feb 10, 2023 · 1 comment · Fixed by #76
Assignees
Labels
unplanned Something that wasn't planned to do but done

Comments

@bitgorbovsky
Copy link

There is no possibility to assign additional exposed ports to container. For example, we want to run some specific server.lua script under tarantool container and this script activates metrics module and exposes them at specific port. On test side we want to check metrics by http, but we have only one port for client connection.

So, we need methods for adding other exposed/mapped ports.

@ArtDu
Copy link
Contributor

ArtDu commented Jun 15, 2023

@bitgorbovsky
We can just open ports by addExposedPorts method before container starting. Like this:

// tarantoolContainer = new TarantoolContainer...
...
tarantoolContainer.addExposedPort(8081);
...
// and we may obtain mapped port after container starting
tarantoolContainer.getMappedPort(8081);

But for this we need to remove withExposedPorts here
https://github.com/tarantool/cartridge-java-testcontainers/blob/d6f21a628c155c78e19dcf87b1636536ebc97cf0/src/main/java/org/testcontainers/containers/TarantoolCartridgeContainer.java#L466
https://github.com/tarantool/cartridge-java-testcontainers/blob/d6f21a628c155c78e19dcf87b1636536ebc97cf0/src/main/java/org/testcontainers/containers/TarantoolContainer.java#L352

which overwrite list with exposed ports on starting stage

@ArtDu ArtDu self-assigned this Jun 15, 2023
@ArtDu ArtDu closed this as completed in #76 Jun 16, 2023
@dkasimovskiy dkasimovskiy added the unplanned Something that wasn't planned to do but done label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unplanned Something that wasn't planned to do but done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants