chore: restructure Docker helper methods#799
Merged
mdelapenya merged 7 commits intotestcontainers:mainfrom Feb 1, 2023
Merged
Conversation
It will allow example modules to consume it
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
mdelapenya
commented
Jan 31, 2023
| return inAContainer("/.dockerenv") | ||
| } | ||
|
|
||
| func inAContainer(path string) bool { |
eddumelendez
approved these changes
Feb 1, 2023
mdelapenya
added a commit
to mdelapenya/testcontainers-go
that referenced
this pull request
Feb 10, 2023
* main: chore: update Docker labels for containers (testcontainers#813) fix: nil pointer dereference in HealthStrategy (testcontainers#802) fix: Synchronise writes to containers map (testcontainers#812) chore(deps): bump google.golang.org/api from 0.108.0 to 0.109.0 in /examples (testcontainers#810) chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#806) chore: restructure Docker helper methods (testcontainers#799) Verify Reaper state to create new or return existing instance (#782) docs: add intel as user (testcontainers#798) chore: bump containerd in examples (testcontainers#797) chore(deps): bump github.com/containerd/containerd from 1.6.15 to 1.6.16 (testcontainers#793) chore: extract docker host calculation to an internal package (testcontainers#796) chore: run "go mod tidy" automatically when creating examples (testcontainers#794) chore: build images with backoff retries (testcontainers#792) fix: use right import package for compose in docs (testcontainers#791) chore(deps): bump google.golang.org/grpc from 1.52.1 to 1.52.3 in /examples (testcontainers#790) Add devcontainer file (#765) chore: check dependabot dependencies weekly (testcontainers#789) chore(deps): bump google.golang.org/grpc from 1.52.0 to 1.52.1 in /examples (#783) chore: support for titles in examples (#775)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
this PR leverages the new internal
testcontainersdockerpackage to move there a few utility functions used to check certain state in Docker, such asWe were not able to move the calculation of the daemonHost to the internal package because it's coupled with the DockerProvider struct, and moving the function to the internal would have caused a package cycle.
Therefore we are simply exposing the DaemonHost function in the DockerProvider struct, so that it can be consumed from anybody being able to obtain a DockerProvider instance using the NewDockerProvider function.
This new exposed function will call the already existing one, which was already private and easy to rename/move.
Why is it important?
These changes come with two major improvements:
Related issues