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

Use hostname instead of hardcoded "name" string #1335

Merged
merged 3 commits into from Mar 24, 2019

Conversation

worldtiki
Copy link
Contributor

@worldtiki worldtiki commented Mar 23, 2019

Proposal to use hostname instead of hardcoded string to allow for multiple proxies to be created.

In my use case I have multiple proxies: one for redis, another for a mock http server, etc.
With the current implementation, when I try to create the second proxy it fails with a "409 - proxy already exists".
This is because in the "getProxy" method we have the name of the proxy hardcoded to "name".

final Proxy proxy = client.createProxy("name", "0.0.0.0:" + toxiPort, upstream);

I am not sure if this requires a new test case with two proxies, and since it's the first time I'm contributing to this project I figured it would be better to get some feedback on the change before doing anything big.

@bsideup
Copy link
Member

bsideup commented Mar 23, 2019 via email

…ToxiproxyContainer.java

Co-Authored-By: worldtiki <worldtiki@gmail.com>
@bsideup
Copy link
Member

bsideup commented Mar 23, 2019

@worldtiki could you please add a test for this change?

@bsideup bsideup added this to the next milestone Mar 23, 2019
@rnorth
Copy link
Member

rnorth commented Mar 23, 2019

Damn, this is a clear bug, sorry. The "name" string is obviously a placeholder that should have taken a proper value.

Thanks for identifying, @worldtiki.

@rnorth
Copy link
Member

rnorth commented Mar 24, 2019

I'll contribute a test to this, in the interests of time.

@rnorth
Copy link
Member

rnorth commented Mar 24, 2019

I've added a simple test - no need for you to add one @worldtiki.

@bsideup bsideup merged commit f2fc02c into testcontainers:master Mar 24, 2019
@bsideup
Copy link
Member

bsideup commented Mar 24, 2019

@worldtiki thanks for spotting the bug and implementing the fix! 👍 We will release it today as a hotfix

@rnorth rnorth modified the milestones: next, 1.11.1 Mar 26, 2019
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.

None yet

3 participants