Merge pull request #15407 from calavera/daemon_supported_flag

Add platformSupported flag to enable daemon mode by platform.
This commit is contained in:
Brian Goff 2015-08-07 13:45:10 -04:00
commit 510ecbf371
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) config.DisableBridge = isBridgeNetworkDisabled(config)
// Verify the platform is supported as a daemon // Verify the platform is supported as a daemon
if runtime.GOOS != "linux" && runtime.GOOS != "windows" { if !platformSupported {
return nil, ErrSystemNotSupported return nil, ErrSystemNotSupported
} }

View File

@ -1,4 +1,4 @@
// +build !windows // +build linux freebsd
package daemon 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 // See https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/kernel/sched/sched.h?id=8cd9234c64c584432f6992fe944ca9e46ca8ea76#n269
linuxMinCPUShares = 2 linuxMinCPUShares = 2
linuxMaxCPUShares = 262144 linuxMaxCPUShares = 262144
platformSupported = true
) )
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) { 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" "github.com/microsoft/hcsshim"
) )
const DefaultVirtualSwitch = "Virtual Switch" const (
DefaultVirtualSwitch = "Virtual Switch"
platformSupported = true
)
func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) { func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) {
return daemon.driver.Changes(container.ID, container.ImageID) return daemon.driver.Changes(container.ID, container.ImageID)