From 8f303bd8480348c6205b561bcd020fa3f378805a Mon Sep 17 00:00:00 2001 From: sh7dm Date: Tue, 22 Jan 2019 17:27:31 +0300 Subject: [PATCH] ContainerCreate shouldn't return warnings=nil Fixes #38222 Closes #38614 (carried) Signed-off-by: Tibor Vass --- daemon/create.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/create.go b/daemon/create.go index 6dc87bdc5d..a544ed67e0 100644 --- a/daemon/create.go +++ b/daemon/create.go @@ -96,6 +96,10 @@ func (daemon *Daemon) containerCreate(opts createOpts) (containertypes.Container } containerActions.WithValues("create").UpdateSince(start) + if warnings == nil { + warnings = make([]string, 0) // Create an empty slice to avoid https://github.com/moby/moby/issues/38222 + } + return containertypes.ContainerCreateCreatedBody{ID: container.ID, Warnings: warnings}, nil }