Skip to content

Commit

Permalink
[release]Adaptive Docker Client API Version
Browse files Browse the repository at this point in the history
DFSL will automatically configure its docker client with the maximum api version for the server.
  • Loading branch information
thomasjpfan committed Jun 3, 2018
1 parent 0b3badb commit 2746389
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion service/test_utils.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package service

import (
"context"
"fmt"
"os/exec"
"strings"
Expand All @@ -23,7 +24,12 @@ func destroyNode(name string) {
func newTestNodeDockerClient(nodeName string) (*client.Client, error) {
host := fmt.Sprintf("tcp://%s:2375", nodeName)
defaultHeaders := map[string]string{"User-Agent": "engine-api-cli-1.0"}
return client.NewClient(host, dockerAPIVersion, nil, defaultHeaders)
cli, err := client.NewClient(host, dockerAPIVersion, nil, defaultHeaders)
if err != nil {
return cli, err
}
cli.NegotiateAPIVersion(context.Background())
return cli, err
}

func getWorkerToken(nodeName string) string {
Expand Down

0 comments on commit 2746389

Please sign in to comment.