ProxyTransportFor discovers the Docker Desktop endpoint via apiClient and returns the matching transport, or nil when DD is not active or discovery fails (so callers fall back to their own default transport).
(ctx context.Context, apiClient client.APIClient)
| 178 | // returns the matching transport, or nil when DD is not active or discovery |
| 179 | // fails (so callers fall back to their own default transport). |
| 180 | func ProxyTransportFor(ctx context.Context, apiClient client.APIClient) http.RoundTripper { |
| 181 | endpoint, err := Endpoint(ctx, apiClient) |
| 182 | if err != nil { |
| 183 | logrus.Debugf("could not detect Docker Desktop endpoint, deferring to caller's default transport: %v", err) |
| 184 | return nil |
| 185 | } |
| 186 | return ProxyTransport(endpoint) |
| 187 | } |
no test coverage detected