Skip to content

Commit b8e87cf

Browse files
authored
Merge pull request #38089 from thaJeztah/fix_api_version
Update API version to v1.40
2 parents 1f5026e + c20aa78 commit b8e87cf

5 files changed

Lines changed: 26 additions & 21 deletions

File tree

api/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package api // import "github.com/docker/docker/api"
33
// Common constants for daemon and client.
44
const (
55
// DefaultVersion of Current REST API
6-
DefaultVersion = "1.39"
6+
DefaultVersion = "1.40"
77

88
// NoBaseImageSpecifier is the symbol used by the FROM
99
// command to specify that no base image is to be used.

api/server/router/swarm/cluster_routes.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ func (sr *swarmRouter) createService(ctx context.Context, w http.ResponseWriter,
186186
if versions.LessThan(cliVersion, "1.30") {
187187
queryRegistry = true
188188
}
189-
if versions.LessThan(cliVersion, "1.39") {
189+
if versions.LessThan(cliVersion, "1.40") {
190190
if service.TaskTemplate.ContainerSpec != nil {
191191
// Sysctls for docker swarm services weren't supported before
192-
// API version 1.39
192+
// API version 1.40
193193
service.TaskTemplate.ContainerSpec.Sysctls = nil
194194
}
195195
}
@@ -229,10 +229,10 @@ func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter,
229229
if versions.LessThan(cliVersion, "1.30") {
230230
queryRegistry = true
231231
}
232-
if versions.LessThan(cliVersion, "1.39") {
232+
if versions.LessThan(cliVersion, "1.40") {
233233
if service.TaskTemplate.ContainerSpec != nil {
234234
// Sysctls for docker swarm services weren't supported before
235-
// API version 1.39
235+
// API version 1.40
236236
service.TaskTemplate.ContainerSpec.Sysctls = nil
237237
}
238238
}

api/swagger.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ produces:
1919
consumes:
2020
- "application/json"
2121
- "text/plain"
22-
basePath: "/v1.39"
22+
basePath: "/v1.40"
2323
info:
2424
title: "Docker Engine API"
25-
version: "1.39"
25+
version: "1.40"
2626
x-logo:
2727
url: "https://docs.docker.com/images/logo-docker-main.png"
2828
description: |
@@ -49,8 +49,8 @@ info:
4949
the URL is not supported by the daemon, a HTTP `400 Bad Request` error message
5050
is returned.
5151
52-
If you omit the version-prefix, the current version of the API (v1.39) is used.
53-
For example, calling `/info` is the same as calling `/v1.39/info`. Using the
52+
If you omit the version-prefix, the current version of the API (v1.40) is used.
53+
For example, calling `/info` is the same as calling `/v1.40/info`. Using the
5454
API without a version-prefix is deprecated and will be removed in a future release.
5555
5656
Engine releases in the near future should support this version of the API,

docs/api/version-history.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ keywords: "API, Docker, rcli, REST, documentation"
1313
will be rejected.
1414
-->
1515

16+
## v1.40 API changes
17+
18+
[Docker Engine API v1.40](https://docs.docker.com/engine/api/v1.40/) documentation
19+
20+
* `GET /services` now returns `Sysctls` as part of the `ContainerSpec`.
21+
* `GET /services/{id}` now returns `Sysctls` as part of the `ContainerSpec`.
22+
* `POST /services/create` now accepts `Sysctls` as part of the `ContainerSpec`.
23+
* `POST /services/{id}/update` now accepts `Sysctls` as part of the `ContainerSpec`.
24+
* `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`.
25+
* `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`.
26+
* `GET /nodes` now supports a filter type `node.label` filter to filter nodes based
27+
on the node.label. The format of the label filter is `node.label=<key>`/`node.label=<key>=<value>`
28+
to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>`
29+
to return those without the specified labels.
30+
1631
## V1.39 API changes
1732

1833
[Docker Engine API v1.39](https://docs.docker.com/engine/api/v1.39/) documentation
@@ -26,16 +41,6 @@ keywords: "API, Docker, rcli, REST, documentation"
2641
* `POST /swarm/init` now accepts a `DefaultAddrPool` property to set global scope default address pool
2742
* `POST /swarm/init` now accepts a `SubnetSize` property to set global scope networks by giving the
2843
length of the subnet masks for every such network
29-
* `GET /nodes` now supports a filter type `node.label` filter to filter nodes based
30-
on the node.label. The format of the label filter is `node.label=<key>`/`node.label=<key>=<value>`
31-
to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>`
32-
to return those without the specified labels.
33-
* `GET /services` now returns `Sysctls` as part of the `ContainerSpec`.
34-
* `GET /services/{id}` now returns `Sysctls` as part of the `ContainerSpec`.
35-
* `POST /services/create` now accepts `Sysctls` as part of the `ContainerSpec`.
36-
* `POST /services/{id}/update` now accepts `Sysctls` as part of the `ContainerSpec`.
37-
* `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`.
38-
* `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`.
3944

4045
## V1.38 API changes
4146

integration/service/create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ func TestCreateServiceConfigFileMode(t *testing.T) {
339339
// anything up in the test environment
340340
func TestCreateServiceSysctls(t *testing.T) {
341341
skip.If(
342-
t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"),
343-
"setting service sysctls is unsupported before api v1.39",
342+
t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"),
343+
"setting service sysctls is unsupported before api v1.40",
344344
)
345345

346346
defer setupTest(t)()

0 commit comments

Comments
 (0)