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: use regex to find container by name #558
Conversation
@hwwwi I'm surprised that the Docker client is not retrieving the right one, but to be fair not sure if we checked the filter in the case multiple containers are run at the same time with the same prefix name. Thanks anyway for opening this PR, I think it must be addresses. Could you please add a test demonstrating the bug? 🙏 |
24b0053
to
62e95c4
Compare
@mdelapenya Thanks for the reply :) |
62e95c4
to
568a25d
Compare
Codecov Report
@@ Coverage Diff @@
## main #558 +/- ##
=======================================
Coverage 69.16% 69.16%
=======================================
Files 22 22
Lines 2186 2186
=======================================
Hits 1512 1512
Misses 535 535
Partials 139 139
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
The fix makes sense from a technical perspective. However, regarding the |
@kiview what do you think if we proceed with the merge, and create a discussion/issue to refactor how the reuse container feature works: if I understood correctly, a container should be reused if and only if the container request (Go abstraction) is exactly the same, identified by a unique hash of the struct representing the request. |
Yep, semantically that's it. Indeed, we can align with the |
Issue
fix #557: [Bug]: Wrong container selected when reuse option enabled
Description
client.ContainerList
will return all the container which contains the given name in the filter.We should check all the names of the container from the list to find the right container.(Update) The name filter uses the regex pattern to find the container, the order of the container is not guaranteed.