Skip to content

Commit 0fd5a65

Browse files
committed
Stop using deprecated SockRequest
Signed-off-by: Stanislav Bondarenko <[email protected]>
1 parent cdf870b commit 0fd5a65

32 files changed

Lines changed: 1389 additions & 1155 deletions

integration-cli/daemon/daemon.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import (
1414
"strings"
1515
"time"
1616

17+
"github.com/docker/docker/api"
1718
"github.com/docker/docker/api/types"
1819
"github.com/docker/docker/api/types/events"
20+
"github.com/docker/docker/client"
1921
"github.com/docker/docker/integration-cli/checker"
2022
"github.com/docker/docker/integration-cli/request"
2123
"github.com/docker/docker/opts"
@@ -752,6 +754,16 @@ func (d *Daemon) ReloadConfig() error {
752754
return nil
753755
}
754756

757+
// NewClient creates new client based on daemon's socket path
758+
func (d *Daemon) NewClient() (*client.Client, error) {
759+
httpClient, err := request.NewHTTPClient(d.Sock())
760+
if err != nil {
761+
return nil, err
762+
}
763+
764+
return client.NewClient(d.Sock(), api.DefaultVersion, httpClient, nil)
765+
}
766+
755767
// WaitInspectWithArgs waits for the specified expression to be equals to the specified expected string in the given time.
756768
// Deprecated: use cli.WaitCmd instead
757769
func WaitInspectWithArgs(dockerBinary, name, expr, expected string, timeout time.Duration, arg ...string) error {

0 commit comments

Comments
 (0)