From 0ffaa6c7858f0a5d85318efda43a2d20a684eae2 Mon Sep 17 00:00:00 2001 From: Cory Snider Date: Fri, 17 Feb 2023 15:06:19 -0500 Subject: 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 --- api/server/router/container/container_routes.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api/server') 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 != "" { -- cgit v1.2.1