Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix DinD host detection when using local socket
When using IPC socket (unix/npipe) to communicate with local docker server docker-py implementation rewrites the base url to HTTP, see https://github.com/docker/docker-py/blob/e901eac7a8c5f29c7720eafb9f58c8356cca2324/docker/api/client.py#L143-L168 We cannot rely on URL scheme in order to detect such connections. Instead, we detect connection adapters added by docker-py api client: - UnixHTTPAdapter https://github.com/docker/docker-py/blob/e901eac7a8c5f29c7720eafb9f58c8356cca2324/docker/transport/unixconn.py - NpipeHTTPAdapter https://github.com/docker/docker-py/blob/e901eac7a8c5f29c7720eafb9f58c8356cca2324/docker/transport/npipeconn.py As NpipeHTTPAdapter type may not be available outside of Windows we rely on adapter-specific attributes.
- Loading branch information