Skip to content

chore: enrich HTTP headers to the Docker daemon with the project path#2080

Merged
mdelapenya merged 2 commits intotestcontainers:mainfrom
mdelapenya:project-path-header
Jan 9, 2024
Merged

chore: enrich HTTP headers to the Docker daemon with the project path#2080
mdelapenya merged 2 commits intotestcontainers:mainfrom
mdelapenya:project-path-header

Conversation

@mdelapenya
Copy link
Copy Markdown
Member

@mdelapenya mdelapenya commented Jan 8, 2024

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:

  • project path for the root package will be /Users/mdelapenya/sourcecode/src/github.com/testcontainers/testcontainers-go.
  • project path for the wait package will be /Users/mdelapenya/sourcecode/src/github.com/testcontainers/testcontainers-go too.

On the other hand, running the tests of the wait package of this library with go test ./... -v, from the wait dir:

  • project path for the wait package will be /Users/mdelapenya/sourcecode/src/github.com/testcontainers/testcontainers-go/wait, as expected.

Finally, it renames the testcontainerssession internal package to core, 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

@mdelapenya mdelapenya requested a review from a team as a code owner January 8, 2024 17:03
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Jan 8, 2024
@mdelapenya mdelapenya self-assigned this Jan 8, 2024
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 8, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 6c31398
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/659c2ac9ac2ad60008c5301c
😎 Deploy Preview https://deploy-preview-2080--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya mdelapenya changed the title chore: enrich Docker calls' HTTP headers with the project path chore: enrich HTTP headers to the Docker daemon with the project path Jan 9, 2024
@mdelapenya mdelapenya merged commit 34325b3 into testcontainers:main Jan 9, 2024
mdelapenya added a commit to jespino/testcontainers-go that referenced this pull request Jan 9, 2024
* main:
  chore: move internal/testcontainersdocker package's files to internal/core (testcontainers#2083)
  GenericContainer: in case of error: return a reference to the failed container (testcontainers#2082)
  [breaking] Add err chan to log producer and don't panic on error (testcontainers#1971)
  chore: enrich HTTP headers to the Docker daemon with the project path (testcontainers#2080)
  fix: align codeql versions in GH workflow (testcontainers#2081)
  chore(deps): bump go.mongodb.org/mongo-driver in /modules/mongodb (testcontainers#2065)
  chore(deps): bump github.com/shirou/gopsutil/v3 from 3.23.11 to 3.23.12 (testcontainers#2068)
  fix(modules.gcloud): pass as ptr to allow request customization (testcontainers#1972)
  chore(deps): bump github.com/twmb/franz-go in /modules/redpanda (testcontainers#2072)
  chore(deps): bump k8s.io/api, k8s.io/apimachinery, k8s.io/client-go from 0.28.4 to 0.29.0 in /modules/k3s (testcontainers#2078)
  chore(deps): bump github.com/ClickHouse/clickhouse-go/v2 (testcontainers#2066)
  chore(deps): bump github.com/google/uuid from 1.4.0 to 1.5.0 (testcontainers#2077)
  bump google.golang.org/api from 0.153.0 to 0.154.0, cloud.google.com/go/spanner from 1.53.1 to 1.54.0, bump google.golang.org/grpc from 1.59.0 to 1.60.1 in /modules/gcloud (testcontainers#2076)
  chore(deps): bump github.com/aws/aws-sdk-go-v2 from 1.23.5 to 1.24.0 (credentials from 1.16.9 to 1.16.13, service/s3 from 1.47.1 to 1.47.7)  in /modules/localstack (testcontainers#2075)
  chore(deps): bump github/codeql-action from 2 to 3 (testcontainers#2056)
  chore(deps): bump test-summary/action from 2.1 to 2.2 (testcontainers#2058)
  chore(deps): bump actions/setup-go from 4 to 5 (testcontainers#2057)
@mdelapenya mdelapenya deleted the project-path-header branch January 29, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant