From 6b4ad8d6f51f43711846945e2dd8ad40d7020b53 Mon Sep 17 00:00:00 2001 From: John Howard Date: Thu, 10 Nov 2016 14:35:19 -0800 Subject: [PATCH] Windows: Additional client check Signed-off-by: John Howard --- daemon/daemon_windows.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go index 0b3c2c82cd..8931f28176 100644 --- a/daemon/daemon_windows.go +++ b/daemon/daemon_windows.go @@ -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) { 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...) if err != nil { return warnings, err } - return warnings, nil }