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:
parent
38e5764132
commit
10d30c6457
4 changed files with 12 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
5
daemon/daemon_unsupported.go
Normal file
5
daemon/daemon_unsupported.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// +build !linux,!freebsd,!windows
|
||||||
|
|
||||||
|
package daemon
|
||||||
|
|
||||||
|
const platformSupported = false
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue