Refactor and improve libcontainer and driver

Remove logging for now because it is complicating things
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-02-24 21:11:52 -08:00
parent 0e4d946dc4
commit 6daf56799f
11 changed files with 84 additions and 116 deletions

View file

@ -2,9 +2,10 @@ package nsinit
import (
"github.com/dotcloud/docker/pkg/libcontainer"
"log"
)
// NsInit is an interface with the public facing methods to provide high level
// exec operations on a container
type NsInit interface {
Exec(container *libcontainer.Container, term Terminal, args []string) (int, error)
ExecIn(container *libcontainer.Container, nspid int, args []string) (int, error)
@ -13,17 +14,13 @@ type NsInit interface {
type linuxNs struct {
root string
logFile string
logger *log.Logger
commandFactory CommandFactory
stateWriter StateWriter
}
func NewNsInit(logger *log.Logger, logFile string, command CommandFactory, state StateWriter) NsInit {
func NewNsInit(command CommandFactory, state StateWriter) NsInit {
return &linuxNs{
logger: logger,
commandFactory: command,
stateWriter: state,
logFile: logFile,
}
}