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

fix: pass docker context key when reusing a container #550

Merged
merged 7 commits into from Oct 19, 2022

Conversation

mdelapenya
Copy link
Collaborator

@mdelapenya mdelapenya commented Oct 5, 2022

What does this PR do?

It passes the docker_host key to the reaper creation when using the ReuseOrCreate container function, so that the reaper is able to extract the Docker host.

Reuse is available as a field in the GenericContainerRequest struct.

At the same time, the PR is adding tests to demonstrate the new behavior

Why is it important?

Consistency. Any other call to NewReaper is passing the host from the provider. Before these changes it was not passed, so the reaper directly returns /var/run/docker.sock when the TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE environment variable is not set.

@mdelapenya mdelapenya requested a review from a team as a code owner October 5, 2022 10:47
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Oct 5, 2022
@mdelapenya mdelapenya self-assigned this Oct 5, 2022
@mdelapenya mdelapenya requested a review from a team October 5, 2022 10:47
@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #550 (fbacba5) into main (db41dd1) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #550   +/-   ##
=======================================
  Coverage   15.08%   15.08%           
=======================================
  Files          13       13           
  Lines        1757     1757           
=======================================
  Hits          265      265           
  Misses       1446     1446           
  Partials       46       46           
Impacted Files Coverage Δ
docker.go 20.17% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mdelapenya mdelapenya removed the request for review from a team October 7, 2022 05:57
* chore: create network's session ID for reaper, only

* chore: include reaper-specific labels to the reaper container

* feat: initialise sessionID just once

* chore: do not expose the sessionID function

* fix: update reaper tests
* main:
  feat: add sessionID HTTP Header to the Docker client setup (#570)
@mdelapenya mdelapenya added type/bug and removed chore Changes that do not impact the existing functionality labels Oct 19, 2022
@mdelapenya mdelapenya merged commit 322aa4e into testcontainers:main Oct 19, 2022
@mdelapenya mdelapenya deleted the fix-ryuk-context branch October 19, 2022 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant