diff --git a/container/podman/client.go b/container/podman/client.go index f51720a734..af33ebeaf5 100644 --- a/container/podman/client.go +++ b/container/podman/client.go @@ -19,7 +19,7 @@ import ( "fmt" "net" "net/http" - "net/url" + urllib "net/url" ) type clientKey struct{} @@ -29,23 +29,23 @@ func (c clientKey) String() string { } type Connection struct { - URI *url.URL + URI *urllib.URL Client *http.Client } func client(ctx *context.Context) (*Connection, error) { - _url, err := url.Parse(*endpointFlag) + url, err := urllib.Parse(*endpointFlag) if err != nil { return nil, err } - switch _url.Scheme { + switch url.Scheme { case "unix": - connection := Connection{URI: _url} + connection := Connection{URI: url} connection.Client = &http.Client{ Transport: &http.Transport{ DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { - return (&net.Dialer{}).DialContext(ctx, "unix", _url.Path) + return (&net.Dialer{}).DialContext(ctx, "unix", url.Path) }, DisableCompression: true, }, diff --git a/container/podman/podman.go b/container/podman/podman.go index 53b87977f4..4f2cc7b95f 100644 --- a/container/podman/podman.go +++ b/container/podman/podman.go @@ -45,10 +45,6 @@ func validateResponse(gotError error, response *http.Response) error { err = fmt.Errorf("item not found") case response.StatusCode == http.StatusNotImplemented: err = fmt.Errorf("query not implemented") - case response.StatusCode != http.StatusOK: - err = fmt.Errorf("status not ok") - case gotError == nil: - return nil default: return gotError }