mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Windows: Additional client check
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
a851cad25c
commit
6b4ad8d6f5
1 changed files with 8 additions and 2 deletions
|
@ -192,12 +192,18 @@ func verifyContainerResources(resources *containertypes.Resources, isHyperv bool
|
||||||
func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.HostConfig, config *containertypes.Config, update bool) ([]string, error) {
|
func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.HostConfig, config *containertypes.Config, update bool) ([]string, error) {
|
||||||
warnings := []string{}
|
warnings := []string{}
|
||||||
|
|
||||||
w, err := verifyContainerResources(&hostConfig.Resources, daemon.runAsHyperVContainer(hostConfig))
|
hyperv := daemon.runAsHyperVContainer(hostConfig)
|
||||||
|
if !hyperv && system.IsWindowsClient() {
|
||||||
|
// @engine maintainers. This block should not be removed. It partially enforces licensing
|
||||||
|
// restrictions on Windows. Ping @jhowardmsft if there are concerns or PRs to change this.
|
||||||
|
return warnings, fmt.Errorf("Windows client operating systems only support Hyper-V containers")
|
||||||
|
}
|
||||||
|
|
||||||
|
w, err := verifyContainerResources(&hostConfig.Resources, hyperv)
|
||||||
warnings = append(warnings, w...)
|
warnings = append(warnings, w...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return warnings, err
|
return warnings, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return warnings, nil
|
return warnings, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue