Browse code

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

add warnings when verifying container settings

Brian Goff authored on 2016/09/09 01:10:37
Showing 1 changed files
... ...
@@ -464,10 +464,13 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
464 464
 	}
465 465
 
466 466
 	w, err := verifyContainerResources(&hostConfig.Resources, sysInfo, update)
467
+
468
+	// no matter err is nil or not, w could have data in itself.
469
+	warnings = append(warnings, w...)
470
+
467 471
 	if err != nil {
468 472
 		return warnings, err
469 473
 	}
470
-	warnings = append(warnings, w...)
471 474
 
472 475
 	if hostConfig.ShmSize < 0 {
473 476
 		return warnings, fmt.Errorf("SHM size can not be less than 0")