Browse code

ContainerCreate shouldn't return warnings=nil

Fixes #38222
Closes #38614 (carried)

Signed-off-by: Tibor Vass <tibor@docker.com>

sh7dm authored on 2019/01/22 23:27:31
Showing 1 changed files
... ...
@@ -96,6 +96,10 @@ func (daemon *Daemon) containerCreate(opts createOpts) (containertypes.Container
96 96
 	}
97 97
 	containerActions.WithValues("create").UpdateSince(start)
98 98
 
99
+	if warnings == nil {
100
+		warnings = make([]string, 0) // Create an empty slice to avoid https://github.com/moby/moby/issues/38222
101
+	}
102
+
99 103
 	return containertypes.ContainerCreateCreatedBody{ID: container.ID, Warnings: warnings}, nil
100 104
 }
101 105