From cb9d2cb71b9265af566fcaace0e52dca54520288 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 26 Oct 2018 15:39:36 +0200 Subject: [PATCH] Move support for sysctl options in services to API v1.40 This feature was added in 14da20f5e79fc322208ec49edce34e0b575d8973, 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 --- api/server/router/swarm/cluster_routes.go | 8 ++++---- docs/api/version-history.md | 12 ++++++------ integration/service/create_test.go | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/server/router/swarm/cluster_routes.go b/api/server/router/swarm/cluster_routes.go index f984328322..600551714c 100644 --- a/api/server/router/swarm/cluster_routes.go +++ b/api/server/router/swarm/cluster_routes.go @@ -186,10 +186,10 @@ func (sr *swarmRouter) createService(ctx context.Context, w http.ResponseWriter, if versions.LessThan(cliVersion, "1.30") { queryRegistry = true } - if versions.LessThan(cliVersion, "1.39") { + if versions.LessThan(cliVersion, "1.40") { if service.TaskTemplate.ContainerSpec != nil { // Sysctls for docker swarm services weren't supported before - // API version 1.39 + // API version 1.40 service.TaskTemplate.ContainerSpec.Sysctls = nil } } @@ -229,10 +229,10 @@ func (sr *swarmRouter) updateService(ctx context.Context, w http.ResponseWriter, if versions.LessThan(cliVersion, "1.30") { queryRegistry = true } - if versions.LessThan(cliVersion, "1.39") { + if versions.LessThan(cliVersion, "1.40") { if service.TaskTemplate.ContainerSpec != nil { // Sysctls for docker swarm services weren't supported before - // API version 1.39 + // API version 1.40 service.TaskTemplate.ContainerSpec.Sysctls = nil } } diff --git a/docs/api/version-history.md b/docs/api/version-history.md index 03ef55dfca..bc39408caf 100644 --- a/docs/api/version-history.md +++ b/docs/api/version-history.md @@ -17,6 +17,12 @@ keywords: "API, Docker, rcli, REST, documentation" [Docker Engine API v1.40](https://docs.docker.com/engine/api/v1.40/) documentation +* `GET /services` now returns `Sysctls` as part of the `ContainerSpec`. +* `GET /services/{id}` now returns `Sysctls` as part of the `ContainerSpec`. +* `POST /services/create` now accepts `Sysctls` as part of the `ContainerSpec`. +* `POST /services/{id}/update` now accepts `Sysctls` as part of the `ContainerSpec`. +* `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`. +* `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`. ## V1.39 API changes @@ -35,12 +41,6 @@ keywords: "API, Docker, rcli, REST, documentation" on the node.label. The format of the label filter is `node.label=`/`node.label==` to return those with the specified labels, or `node.label!=`/`node.label!==` to return those without the specified labels. -* `GET /services` now returns `Sysctls` as part of the `ContainerSpec`. -* `GET /services/{id}` now returns `Sysctls` as part of the `ContainerSpec`. -* `POST /services/create` now accepts `Sysctls` as part of the `ContainerSpec`. -* `POST /services/{id}/update` now accepts `Sysctls` as part of the `ContainerSpec`. -* `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`. -* `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`. ## V1.38 API changes diff --git a/integration/service/create_test.go b/integration/service/create_test.go index f5a5a6dc56..8b46fe94e6 100644 --- a/integration/service/create_test.go +++ b/integration/service/create_test.go @@ -339,8 +339,8 @@ func TestCreateServiceConfigFileMode(t *testing.T) { // anything up in the test environment func TestCreateServiceSysctls(t *testing.T) { skip.If( - t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), - "setting service sysctls is unsupported before api v1.39", + t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"), + "setting service sysctls is unsupported before api v1.40", ) defer setupTest(t)()