mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Reuse *sysinfo.SysInfo instance in verification
Signed-off-by: Alexander Morozov <lk4d4@docker.com> Upstream-commit: 22ebeede3010e30a0b74c58900f7ed08f7489f93 Component: engine
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user