diff --git a/components/engine/api/server/router/container/container_routes.go b/components/engine/api/server/router/container/container_routes.go index 2852623fe9..078352fb8d 100644 --- a/components/engine/api/server/router/container/container_routes.go +++ b/components/engine/api/server/router/container/container_routes.go @@ -520,9 +520,9 @@ func (s *containerRouter) wsContainersAttach(ctx context.Context, w http.Respons }() conn := <-wsChan - // In case version is higher than 1.26, a binary frame will be sent. + // In case version is higher than 1.27, a binary frame will be sent. // See 28176 for details. - if versions.GreaterThanOrEqualTo(version, "1.26") { + if versions.GreaterThanOrEqualTo(version, "1.27") { conn.PayloadType = websocket.BinaryFrame } return conn, conn, conn, nil diff --git a/components/engine/api/server/router/network/network_routes.go b/components/engine/api/server/router/network/network_routes.go index 970a391f3d..5427de62d8 100644 --- a/components/engine/api/server/router/network/network_routes.go +++ b/components/engine/api/server/router/network/network_routes.go @@ -60,11 +60,11 @@ SKIP: } var nr *types.NetworkResource - // Versions < 1.26 fetches all the containers attached to a network + // Versions < 1.27 fetches all the containers attached to a network // in a network list api call. It is a heavy weight operation when - // run across all the networks. Starting API version 1.26, this detailed + // run across all the networks. Starting API version 1.27, this detailed // info is available for network specific GET API (equivalent to inspect) - if versions.LessThan(httputils.VersionFromContext(ctx), "1.26") { + if versions.LessThan(httputils.VersionFromContext(ctx), "1.27") { nr = n.buildDetailedNetworkResources(nw) } else { nr = n.buildNetworkResource(nw) diff --git a/components/engine/cli/command/service/opts.go b/components/engine/cli/command/service/opts.go index 9a0ae64ca9..35c5f2f657 100644 --- a/components/engine/cli/command/service/opts.go +++ b/components/engine/cli/command/service/opts.go @@ -469,7 +469,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) { flags.SetAnnotation(flagTTY, "version", []string{"1.25"}) flags.BoolVar(&opts.readOnly, flagReadOnly, false, "Mount the container's root filesystem as read only") - flags.SetAnnotation(flagReadOnly, "version", []string{"1.26"}) + flags.SetAnnotation(flagReadOnly, "version", []string{"1.27"}) } const ( diff --git a/components/engine/client/client.go b/components/engine/client/client.go index 75cfc8698b..df3698adc6 100644 --- a/components/engine/client/client.go +++ b/components/engine/client/client.go @@ -53,13 +53,11 @@ import ( "path/filepath" "strings" + "github.com/docker/docker/api" "github.com/docker/go-connections/sockets" "github.com/docker/go-connections/tlsconfig" ) -// DefaultVersion is the version of the current stable API -const DefaultVersion string = "1.26" - // Client is the API client that performs all operations // against a docker server. type Client struct { @@ -115,7 +113,7 @@ func NewEnvClient() (*Client, error) { } version := os.Getenv("DOCKER_API_VERSION") if version == "" { - version = DefaultVersion + version = api.DefaultVersion } cli, err := NewClient(host, version, client, nil) diff --git a/components/engine/client/client_test.go b/components/engine/client/client_test.go index 7c26403ebe..64188d5fb1 100644 --- a/components/engine/client/client_test.go +++ b/components/engine/client/client_test.go @@ -11,6 +11,7 @@ import ( "strings" "testing" + "github.com/docker/docker/api" "github.com/docker/docker/api/types" "golang.org/x/net/context" ) @@ -26,7 +27,7 @@ func TestNewEnvClient(t *testing.T) { }{ { envs: map[string]string{}, - expectedVersion: DefaultVersion, + expectedVersion: api.DefaultVersion, }, { envs: map[string]string{ @@ -38,21 +39,21 @@ func TestNewEnvClient(t *testing.T) { envs: map[string]string{ "DOCKER_CERT_PATH": "testdata/", }, - expectedVersion: DefaultVersion, + expectedVersion: api.DefaultVersion, }, { envs: map[string]string{ "DOCKER_CERT_PATH": "testdata/", "DOCKER_TLS_VERIFY": "1", }, - expectedVersion: DefaultVersion, + expectedVersion: api.DefaultVersion, }, { envs: map[string]string{ "DOCKER_CERT_PATH": "testdata/", "DOCKER_HOST": "https://notaunixsocket", }, - expectedVersion: DefaultVersion, + expectedVersion: api.DefaultVersion, }, { envs: map[string]string{ @@ -64,7 +65,7 @@ func TestNewEnvClient(t *testing.T) { envs: map[string]string{ "DOCKER_HOST": "invalid://url", }, - expectedVersion: DefaultVersion, + expectedVersion: api.DefaultVersion, }, { envs: map[string]string{ @@ -262,8 +263,8 @@ func TestNewEnvClientSetsDefaultVersion(t *testing.T) { if err != nil { t.Fatal(err) } - if client.version != DefaultVersion { - t.Fatalf("Expected %s, got %s", DefaultVersion, client.version) + if client.version != api.DefaultVersion { + t.Fatalf("Expected %s, got %s", api.DefaultVersion, client.version) } expected := "1.22"