Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setup docker_host discovery strategies properly (testcontainers…
…#1161) * chore: add helper function to check if a file exists * chore: wrap the extraction of the current docker host into a reusable function * chore: extract part of the algorithm to calculate the docker socket * chore: use constant for default docker socket in tests * chore: extract docker socket from Go context to a function * chore: reuse constant for default docker socket path * chore: detect DOCKER_HOST first * chore: do not fallback to default, return empty string * chore: apply extract docker host function * chore: read properties with context * docs: document the docker host detection strategies * feat: look up rootless docker if docker host was not found * chore: extract modules generator pipeline * chore: add a pipeline for rootless docker * chore: remove duplicated pipeline * chore: define docekr socket path for unix/windows * chore: convert internal constants into vars for testability * chore: use t.Cleanup to restore test state * feat: support for reading the default docker host from unix/windows * chore: move config to internal package * chore: unify how the docker client is retrieved * chore: delegate singleton instance to the internal config * chore: remove DOCKER_HOST env var from config * chore: support resetting the config singleton for testing * feat: read docker host from properties * fix: typo * fix: remove white lines in imports * fix: handle error in tests * chore: apply testcontainers#1160 after merge * chore: do not go through the provider to get a client * fix: honour passed Docker client opts * fix: read properties does not consider reading DOCKER_HOST env var * fix: defer client close after docker ping * feat: extract the docker host when bootstrapping a docker client * chore: honour passed opts for the client * chore: cache docker_host to avoid unnecesary calculations * chor: convert socket schema into constants * chore: support parsing URLs for remote hosts * fix: reaper mounts a socket path without schema * fix: proper comment structure for go linting using golangci-lint * chore: get socket mount without schema * fix: support for disabling rootless for testing * fix: get provider host from the strategies * chore: proper separation of concerns between docker socket and docker host * docs: improve docs for Docker host detection * fix: comments indentation * fix: proper list format in Go comments * docs: document rootless socket path alternatives in code * feat: support for testcontainers host strategy * docs: include new strategy in go comment * fix: use tc.host * fix: proper initialisation of baseRunDir * fix: unset DOCKER_HOST for tests that does not need it * chore: do not print config * fix: include schema in the rootless docker socket path * fix: add schema properly * fix: always prepend the schema $XDG_RUNTIME_DIR does not contain it * fix: proper return when sanitising the docker socket path * chore: proper use of docker socket path * chore: defensively restore env var in tests * fix: make sure the already built image is removed from the local cache * fix: use testcontainers docker client when removing image * fix: update docs * chore: rename variable * fix: add back module generator tests * chore: do not break users for the deprecated fields in the tc config * fix: tc.host takes precedence on TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE for the docker socket
- Loading branch information