зеркало из https://github.com/microsoft/docker.git
daemon: remove sysInitPath, lxc leftover
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Родитель
dd25d2c3db
Коммит
1b726b29b2
|
@ -122,7 +122,6 @@ func (c *contStore) List() []*Container {
|
||||||
type Daemon struct {
|
type Daemon struct {
|
||||||
ID string
|
ID string
|
||||||
repository string
|
repository string
|
||||||
sysInitPath string
|
|
||||||
containers *contStore
|
containers *contStore
|
||||||
execCommands *exec.Store
|
execCommands *exec.Store
|
||||||
tagStore tag.Store
|
tagStore tag.Store
|
||||||
|
@ -811,8 +810,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
||||||
|
|
||||||
d.containerGraphDB = graph
|
d.containerGraphDB = graph
|
||||||
|
|
||||||
var sysInitPath string
|
|
||||||
|
|
||||||
sysInfo := sysinfo.New(false)
|
sysInfo := sysinfo.New(false)
|
||||||
// Check if Devices cgroup is mounted, it is hard requirement for container security,
|
// Check if Devices cgroup is mounted, it is hard requirement for container security,
|
||||||
// on Linux/FreeBSD.
|
// on Linux/FreeBSD.
|
||||||
|
@ -820,7 +817,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
||||||
return nil, fmt.Errorf("Devices cgroup isn't mounted")
|
return nil, fmt.Errorf("Devices cgroup isn't mounted")
|
||||||
}
|
}
|
||||||
|
|
||||||
ed, err := execdrivers.NewDriver(config.ExecOptions, config.ExecRoot, config.Root, sysInitPath, sysInfo)
|
ed, err := execdrivers.NewDriver(config.ExecOptions, config.ExecRoot, config.Root, sysInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -835,7 +832,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
||||||
d.trustKey = trustKey
|
d.trustKey = trustKey
|
||||||
d.idIndex = truncindex.NewTruncIndex([]string{})
|
d.idIndex = truncindex.NewTruncIndex([]string{})
|
||||||
d.configStore = config
|
d.configStore = config
|
||||||
d.sysInitPath = sysInitPath
|
|
||||||
d.execDriver = ed
|
d.execDriver = ed
|
||||||
d.statsCollector = d.newStatsCollector(1 * time.Second)
|
d.statsCollector = d.newStatsCollector(1 * time.Second)
|
||||||
d.defaultLogConfig = config.LogConfig
|
d.defaultLogConfig = config.LogConfig
|
||||||
|
@ -1275,10 +1271,6 @@ func (daemon *Daemon) config() *Config {
|
||||||
return daemon.configStore
|
return daemon.configStore
|
||||||
}
|
}
|
||||||
|
|
||||||
func (daemon *Daemon) systemInitPath() string {
|
|
||||||
return daemon.sysInitPath
|
|
||||||
}
|
|
||||||
|
|
||||||
// GraphDriver returns the currently used driver for processing
|
// GraphDriver returns the currently used driver for processing
|
||||||
// container layers.
|
// container layers.
|
||||||
func (daemon *Daemon) GraphDriver() graphdriver.Driver {
|
func (daemon *Daemon) GraphDriver() graphdriver.Driver {
|
||||||
|
|
|
@ -10,6 +10,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
|
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
|
||||||
func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
|
func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
|
||||||
return nil, fmt.Errorf("jail driver not yet supported on FreeBSD")
|
return nil, fmt.Errorf("jail driver not yet supported on FreeBSD")
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
|
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
|
||||||
func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
|
func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
|
||||||
return native.NewDriver(path.Join(root, "execdriver", "native"), initPath, options)
|
return native.NewDriver(path.Join(root, "execdriver", "native"), options)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
|
// NewDriver returns a new execdriver.Driver from the given name configured with the provided options.
|
||||||
func NewDriver(options []string, root, libPath, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
|
func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
|
||||||
return windows.NewDriver(root, initPath, options)
|
return windows.NewDriver(root, options)
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,6 @@ const (
|
||||||
// it implements execdriver.Driver.
|
// it implements execdriver.Driver.
|
||||||
type Driver struct {
|
type Driver struct {
|
||||||
root string
|
root string
|
||||||
initPath string
|
|
||||||
activeContainers map[string]libcontainer.Container
|
activeContainers map[string]libcontainer.Container
|
||||||
machineMemory int64
|
machineMemory int64
|
||||||
factory libcontainer.Factory
|
factory libcontainer.Factory
|
||||||
|
@ -46,7 +45,7 @@ type Driver struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDriver returns a new native driver, called from NewDriver of execdriver.
|
// NewDriver returns a new native driver, called from NewDriver of execdriver.
|
||||||
func NewDriver(root, initPath string, options []string) (*Driver, error) {
|
func NewDriver(root string, options []string) (*Driver, error) {
|
||||||
meminfo, err := sysinfo.ReadMemInfo()
|
meminfo, err := sysinfo.ReadMemInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -114,7 +113,6 @@ func NewDriver(root, initPath string, options []string) (*Driver, error) {
|
||||||
|
|
||||||
return &Driver{
|
return &Driver{
|
||||||
root: root,
|
root: root,
|
||||||
initPath: initPath,
|
|
||||||
activeContainers: make(map[string]libcontainer.Container),
|
activeContainers: make(map[string]libcontainer.Container),
|
||||||
machineMemory: meminfo.MemTotal,
|
machineMemory: meminfo.MemTotal,
|
||||||
factory: f,
|
factory: f,
|
||||||
|
|
|
@ -42,7 +42,6 @@ type activeContainer struct {
|
||||||
// it implements execdriver.Driver
|
// it implements execdriver.Driver
|
||||||
type Driver struct {
|
type Driver struct {
|
||||||
root string
|
root string
|
||||||
initPath string
|
|
||||||
activeContainers map[string]*activeContainer
|
activeContainers map[string]*activeContainer
|
||||||
sync.Mutex
|
sync.Mutex
|
||||||
}
|
}
|
||||||
|
@ -53,7 +52,7 @@ func (d *Driver) Name() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDriver returns a new windows driver, called from NewDriver of execdriver.
|
// NewDriver returns a new windows driver, called from NewDriver of execdriver.
|
||||||
func NewDriver(root, initPath string, options []string) (*Driver, error) {
|
func NewDriver(root string, options []string) (*Driver, error) {
|
||||||
|
|
||||||
for _, option := range options {
|
for _, option := range options {
|
||||||
key, val, err := parsers.ParseKeyValueOpt(option)
|
key, val, err := parsers.ParseKeyValueOpt(option)
|
||||||
|
@ -92,7 +91,6 @@ func NewDriver(root, initPath string, options []string) (*Driver, error) {
|
||||||
|
|
||||||
return &Driver{
|
return &Driver{
|
||||||
root: root,
|
root: root,
|
||||||
initPath: initPath,
|
|
||||||
activeContainers: make(map[string]*activeContainer),
|
activeContainers: make(map[string]*activeContainer),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,11 +52,6 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
||||||
// that's more intuitive (the copied path is trivial to derive
|
// that's more intuitive (the copied path is trivial to derive
|
||||||
// by hand given VERSION)
|
// by hand given VERSION)
|
||||||
initPath := utils.DockerInitPath("")
|
initPath := utils.DockerInitPath("")
|
||||||
if initPath == "" {
|
|
||||||
// if that fails, we'll just return the path from the daemon
|
|
||||||
initPath = daemon.systemInitPath()
|
|
||||||
}
|
|
||||||
|
|
||||||
sysInfo := sysinfo.New(true)
|
sysInfo := sysinfo.New(true)
|
||||||
|
|
||||||
v := &types.Info{
|
v := &types.Info{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче