-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
feat: Include the container name in the reuse hash #1162
feat: Include the container name in the reuse hash #1162
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
I do not remember, but I thought this was on purpose. However, I think excluding it does not make much sense. IIRC when we initially discussed the feature, we were considering hashing the container response from the Docker Engine API (which contains random names). Nevertheless, LGTM. Could you please update the documentation accordingly?
testcontainers-dotnet/docs/api/resource_reuse.md
Lines 20 to 29 in f6c93d3
- [ContainerConfiguration](https://github.com/testcontainers/testcontainers-dotnet/blob/develop/src/Testcontainers/Configurations/Containers/ContainerConfiguration.cs) | |
- Image | |
- Entrypoint | |
- Command | |
- Environments | |
- ExposedPorts | |
- PortBindings | |
- NetworkAliases | |
- ExtraHosts | |
- Labels |
Of course! I just pushed d715a18 which updates the documentation. |
What does this PR do?
This pull request removes the
[JsonIgnore]
attribute from theContainerConfiguration.Name
property so that the container name becomes part of the reuse hash.Why is it important?
The rationale behind this change is explained in #1161.
Important
Changing the parts used in the reuse hash will break existing reused containers but the best time to do it is now, while the reuse feature is still at the experimental stage.
Related issues
Closes #1161
How to test this PR
A new unit test (
ContainersWithDifferentNamesShouldHaveDifferentHashes
) has been added.