Skip to content

Commit cb9d2cb

Browse files
committed
Move support for sysctl options in services to API v1.40
This feature was added in 14da20f, and was merged after API v1.39 shipped as part of the Docker 18.09 release candidates. This commit moves the feature to the correct API version. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent e238713 commit cb9d2cb

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

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
}

docs/api/version-history.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ keywords: "API, Docker, rcli, REST, documentation"
1717

1818
[Docker Engine API v1.40](https://docs.docker.com/engine/api/v1.40/) documentation
1919

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`.
2026

2127
## V1.39 API changes
2228

@@ -35,12 +41,6 @@ keywords: "API, Docker, rcli, REST, documentation"
3541
on the node.label. The format of the label filter is `node.label=<key>`/`node.label=<key>=<value>`
3642
to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>`
3743
to return those without the specified labels.
38-
* `GET /services` now returns `Sysctls` as part of the `ContainerSpec`.
39-
* `GET /services/{id}` now returns `Sysctls` as part of the `ContainerSpec`.
40-
* `POST /services/create` now accepts `Sysctls` as part of the `ContainerSpec`.
41-
* `POST /services/{id}/update` now accepts `Sysctls` as part of the `ContainerSpec`.
42-
* `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`.
43-
* `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`.
4444

4545
## V1.38 API changes
4646

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)