From 28b291dfda69b6595fbe81beaa45187ff6882313 Mon Sep 17 00:00:00 2001 From: allencloud Date: Thu, 1 Sep 2016 00:23:56 +0800 Subject: [PATCH] add warnings when verify setting Signed-off-by: allencloud --- daemon/daemon_unix.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 1431aabe0c..0de91c45d3 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -464,10 +464,13 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. } w, err := verifyContainerResources(&hostConfig.Resources, sysInfo, update) + + // no matter err is nil or not, w could have data in itself. + warnings = append(warnings, w...) + if err != nil { return warnings, err } - warnings = append(warnings, w...) if hostConfig.ShmSize < 0 { return warnings, fmt.Errorf("SHM size can not be less than 0")