瀏覽代碼

Merge pull request #26205 from allencloud/fix-warnings-append

add warnings when verifying container settings
Brian Goff 8 年之前
父節點
當前提交
b1dfefc4bb
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      daemon/daemon_unix.go

+ 4 - 1
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")