chore: enrich HTTP headers to the Docker daemon with the project path #2080
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?
Following the very same semantics as in #1513, we are capturing the project path for the parent PID in order to be sent to the Docker daemon, using the
x-tc-pp
HTTP header.It will enrich the calls to the Docker daemon, passing the path where the
go test
binary was called.As an example, running the tests of this library with
go test ./... -v
from the root:/Users/mdelapenya/sourcecode/src/github.com/testcontainers/testcontainers-go
./Users/mdelapenya/sourcecode/src/github.com/testcontainers/testcontainers-go
too.On the other hand, running the tests of the
wait
package of this library withgo test ./... -v
, from the wait dir:/Users/mdelapenya/sourcecode/src/github.com/testcontainers/testcontainers-go/wait
, as expected.Finally, it renames the
testcontainerssession
internal package tocore
, internal too. That will be more inclusive with its content.Why is it important?
The Docker daemon could read this HTTP header and perform anything at the engine level, increasing the observability at the Docker API level.
Related issues