-
Notifications
You must be signed in to change notification settings - Fork 142
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: collect bridge IP address correctly #626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution! 🙏
The changes makes sense to me, I've left a couple of minor comments
Wow @DDtKey thanks a lot for the prompt response!! I have pushed your suggestions |
Could you take a look at falling tests? |
Yes, np |
Found some issues with the old approach so I had to switch to determine the network attached to the container by using |
I think we should consider this change as breaking one. Thus, I'm going to include this into |
No problem. Thanks for your time man!
…On Thu, May 9, 2024, 9:35 PM Artem Medvedev ***@***.***> wrote:
I think we should consider this change as breaking one. I mean it's
definitely fixes the described issue, but the behavior has changed.
Thus, I'm going to include this onto 0.17.0.
JFYI: I want to include couple of changes in the next major release, so it
will probably will take some time before releasing (not too long)
—
Reply to this email directly, view it on GitHub
<#626 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQ6LBPCM5FLBW2UJGMKFTZBPFYPAVCNFSM6AAAAABHO4LUI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBTGI4TGOBVGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
#[tokio::test] | ||
async fn async_should_rely_on_network_mode_when_network_is_provided_and_settings_bridge_empty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dlen!
I was about to merge the PR, but wanted to double-check the test coverage and current behavior in main
.
And understood that these tests are passing against it.
I'm just wondering if this could be covered better, because if we change this back - we don't see any failures.
Sorry for the late notice
Yeah I could add more tests, no problem. However I won't be able to look
into it till later next week.
If you have something specific in mind let me know.
…On Fri, May 10, 2024, 11:02 PM Artem Medvedev ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In testcontainers/src/runners/async_runner.rs
<#626 (comment)>
:
> + #[tokio::test]
+ async fn async_should_rely_on_network_mode_when_network_is_provided_and_settings_bridge_empty()
Hi @dlen <https://github.com/dlen>!
I was about to merge the PR, but wanted to double-check the test coverage
and current behavior in main.
And understood that these tests are passing against it.
I'm just wondering if this could be covered better, because if we change
this back - we don't see the crash, however we are aware of some issues.
Sorry for the late notice
—
Reply to this email directly, view it on GitHub
<#626 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALQ6LBH2QET3YPQ4HBBVHTZBUYX5AVCNFSM6AAAAABHO4LUI2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDANJQHA3TGOJZHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Nothing specific at the moment, but I'll think of it a bit later. The main goal is to make a test which fails against main, but passes with new changes. That would be ideal option, as we consider this a fix But in fact, I don't rush you. We even can proceed with this and add tests separately |
## 🤖 New release * `testcontainers`: 0.16.7 -> 0.17.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.17.0] - 2024-05-26 ### Details #### Bug Fixes - Collect bridge IP address correctly ([#626](#626)) - Replace missed panics with `Result` ([#638](#638)) #### Features - Impl `Error` for `WaitError` ([#629](#629)) - [❗] Extend `exec` interface to return logs and exec code ([#631](#631)) - Ability to access container logs ([#633](#633)) - [❗] Switch to fallible API ([#636](#636)) - Make container and exec logs `Send`able ([#637](#637)) - Map container not found error to `eof` for container log streams ([#639](#639)) - Expose follow flag for `stdout` and `stderr` ([#640](#640)) - Add ability to read container logs into `Vec` ([#641](#641)) - [❗] Add container startup timeout with default of 1 minute ([#643](#643)) #### Miscellaneous Tasks - Fix clippy warning without features enabled ([#632](#632)) #### Refactor - [❗] Drop re-export of `CgroupnsMode` accessible through `core` ([#630](#630)) - [❗] Drop previously deprecated `get_host_ip_address` ([#628](#628)) - [❗] Return `PortNotExposed` error from `ContainerState::host_port_*` ([#644](#644)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I bumped into this issue while using https://github.com/testcontainers/testcontainers-rs-modules-community/tree/main/src/mysql
and the latest version of testcontainers-rs.
get_bridge_ip_address
was not returning the correct IP address value. When running a container on GNU/Linux systemsNetworkSettings.bridge
might be an empty string therefore it is not useful as a default value.This PR tries to provide a default value for such scenarios where:
--bridge
flag has been explicitly provided when starting the containerNetworkSettings.bridge
is an empty stringThanks for all the efforts in this project!