testcontainers-go icon indicating copy to clipboard operation
testcontainers-go copied to clipboard

fix: pass docker context key when reusing a container

Open mdelapenya opened this issue 3 years ago • 1 comments

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.

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 avatar Oct 05 '22 10:10 mdelapenya

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%> (ø)

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

codecov[bot] avatar Oct 05 '22 10:10 codecov[bot]