summaryrefslogtreecommitdiff
path: root/api/server
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2023-02-17 15:06:19 -0500
committerCory Snider <csnider@mirantis.com>2023-02-23 18:59:00 -0500
commit0ffaa6c7858f0a5d85318efda43a2d20a684eae2 (patch)
treef7060f2b62ff90a88d4fd12cfa34e4494402331b /api/server
parent50d71649782428e64f891bdf42de8f275589c618 (diff)
downloaddocker-0ffaa6c7858f0a5d85318efda43a2d20a684eae2.tar.gz
daemon: add annotations to container HostConfig
Allow clients to set annotations on a container which will applied to the container's OCI spec. Signed-off-by: Cory Snider <csnider@mirantis.com>
Diffstat (limited to 'api/server')
-rw-r--r--api/server/router/container/container_routes.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api/server/router/container/container_routes.go b/api/server/router/container/container_routes.go
index 827553d62e..9436ab46d8 100644
--- a/api/server/router/container/container_routes.go
+++ b/api/server/router/container/container_routes.go
@@ -563,6 +563,11 @@ func (s *containerRouter) postContainersCreate(ctx context.Context, w http.Respo
hostConfig.ConsoleSize = [2]uint{0, 0}
}
+ if hostConfig != nil && versions.LessThan(version, "1.43") {
+ // Ignore Annotations because it was added in API v1.43.
+ hostConfig.Annotations = nil
+ }
+
var platform *specs.Platform
if versions.GreaterThanOrEqualTo(version, "1.41") {
if v := r.Form.Get("platform"); v != "" {