소스 검색

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 <github@gone.nl>
Sebastiaan van Stijn 6 년 전
부모
커밋
cb9d2cb71b
3개의 변경된 파일12개의 추가작업 그리고 12개의 파일을 삭제
  1. 4 4
      api/server/router/swarm/cluster_routes.go
  2. 6 6
      docs/api/version-history.md
  3. 2 2
      integration/service/create_test.go

+ 4 - 4
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
 			}
 		}

+ 6 - 6
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=<key>`/`node.label=<key>=<value>`
   to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>`
   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
 

+ 2 - 2
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)()