From 6f9e9ee9ece7396a2b769c1e240eaa893cfce2ae Mon Sep 17 00:00:00 2001 From: Jake Parks Date: Thu, 30 Sep 2021 19:41:25 +0000 Subject: Fixes #11668 Adding dial-stdio CLI cmd Signed-off-by: Jake Parks Made dial-stdio URI configurable Slight refactors Signed-off-by: Jake Parks Added simple test for existence of `podman system dial-stdio` command Fix 'system dial-stdio' integration tests Changed link in comment to permalink --- pkg/bindings/connection.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pkg') diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index e2c46e481..dc75dac5a 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -349,6 +349,17 @@ func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string, return &APIResponse{response, req}, err } +// Get raw Transport.DialContext from client +func (c *Connection) GetDialer(ctx context.Context) (net.Conn, error) { + client := c.Client + transport := client.Transport.(*http.Transport) + if transport.DialContext != nil && transport.TLSClientConfig == nil { + return transport.DialContext(ctx, c.URI.Scheme, c.URI.String()) + } + + return nil, errors.New("Unable to get dial context") +} + // FiltersToString converts our typical filter format of a // map[string][]string to a query/html safe string. func FiltersToString(filters map[string][]string) (string, error) { -- cgit v1.2.3-54-g00ecf