Prechádzať zdrojové kódy

Move CgroupnsMode feature to API v1.41

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 6 rokov pred
rodič
commit
7bacd1d6dc

+ 2 - 1
api/server/router/container/container_routes.go

@@ -489,7 +489,8 @@ func (s *containerRouter) postContainersCreate(ctx context.Context, w http.Respo
 		if hostConfig.IpcMode.IsEmpty() {
 			hostConfig.IpcMode = container.IpcMode("shareable")
 		}
-
+	}
+	if hostConfig != nil && versions.LessThan(version, "1.41") {
 		// Older clients expect the default to be "host"
 		if hostConfig.CgroupnsMode.IsEmpty() {
 			hostConfig.CgroupnsMode = container.CgroupnsMode("host")

+ 5 - 5
docs/api/version-history.md

@@ -17,6 +17,11 @@ keywords: "API, Docker, rcli, REST, documentation"
 
 [Docker Engine API v1.41](https://docs.docker.com/engine/api/v1.41/) documentation
 
+* `POST /containers/create` on Linux now accepts the `HostConfig.CgroupnsMode` property.
+  Set the property to `host` to create the container in the daemon's cgroup namespace, or
+  `private` to create the container in its own private cgroup namespace.  The per-daemon
+  default is `host`, and can be changed by using the`CgroupNamespaceMode` daemon configuration
+  parameter.
 
 
 ## v1.40 API changes
@@ -74,11 +79,6 @@ keywords: "API, Docker, rcli, REST, documentation"
 * `POST /containers/{id}/update` now accepts a `PidsLimit` field to tune a container's
   PID limit. Set `0` or `-1` for unlimited. Leave `null` to not change the current value.
 * `POST /build` now accepts `outputs` key for configuring build outputs when using BuildKit mode.
-* `POST /containers/create` on Linux now accepts the `HostConfig.CgroupnsMode` property.
-  Set the property to `host` to create the container in the daemon's cgroup namespace, or
-  `private` to create the container in its own private cgroup namespace.  The per-daemon
-  default is `host`, and can be changed by using the`CgroupNamespaceMode` daemon configuration
-  parameter.
 
 ## V1.39 API changes