mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Reuse *sysinfo.SysInfo instance in verification
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
7bddbdf360
commit
22ebeede30
1 changed files with 2 additions and 3 deletions
|
@ -218,9 +218,8 @@ func (daemon *Daemon) adaptContainerSettings(hostConfig *containertypes.HostConf
|
|||
return nil
|
||||
}
|
||||
|
||||
func verifyContainerResources(resources *containertypes.Resources) ([]string, error) {
|
||||
func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysinfo.SysInfo) ([]string, error) {
|
||||
warnings := []string{}
|
||||
sysInfo := sysinfo.New(true)
|
||||
|
||||
// memory subsystem checks and adjustments
|
||||
if resources.Memory != 0 && resources.Memory < linuxMinMemory {
|
||||
|
@ -372,7 +371,7 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
|
|||
return warnings, err
|
||||
}
|
||||
|
||||
w, err := verifyContainerResources(&hostConfig.Resources)
|
||||
w, err := verifyContainerResources(&hostConfig.Resources, sysInfo)
|
||||
if err != nil {
|
||||
return warnings, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue