1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Add platformSupported flag to enable daemon mode by platform.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera 2015-08-07 09:33:29 -07:00
parent 38e5764132
commit 10d30c6457
4 changed files with 12 additions and 3 deletions

View file

@ -557,7 +557,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
config.DisableBridge = isBridgeNetworkDisabled(config)
// Verify the platform is supported as a daemon
if runtime.GOOS != "linux" && runtime.GOOS != "windows" {
if !platformSupported {
return nil, ErrSystemNotSupported
}

View file

@ -1,4 +1,4 @@
// +build !windows
// +build linux freebsd
package daemon
@ -36,6 +36,7 @@ const (
// See https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/kernel/sched/sched.h?id=8cd9234c64c584432f6992fe944ca9e46ca8ea76#n269
linuxMinCPUShares = 2
linuxMaxCPUShares = 262144
platformSupported = true
)
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {

View file

@ -0,0 +1,5 @@
// +build !linux,!freebsd,!windows
package daemon
const platformSupported = false

View file

@ -15,7 +15,10 @@ import (
"github.com/microsoft/hcsshim"
)
const DefaultVirtualSwitch = "Virtual Switch"
const (
DefaultVirtualSwitch = "Virtual Switch"
platformSupported = true
)
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {
return daemon.driver.Changes(container.ID, container.ImageID)