Small daemon refactoring and add swarm init/join helpers

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 239a8a518904dfb51fe62087d8702519c20ce808
Component: engine
This commit is contained in:
Vincent Demeester
2018-04-16 10:20:10 +02:00
parent 1b1d5ffe90
commit bd6e299583
23 changed files with 129 additions and 167 deletions
@@ -30,21 +30,12 @@ type Daemon struct {
dockerBinary string
}
// Config holds docker daemon integration configuration
type Config struct {
Experimental bool
}
// New returns a Daemon instance to be used for testing.
// This will create a directory such as d123456789 in the folder specified by $DOCKER_INTEGRATION_DAEMON_DEST or $DEST.
// The daemon will not automatically start.
func New(t testingT, dockerBinary string, dockerdBinary string, config Config, ops ...func(*daemon.Daemon)) *Daemon {
func New(t testingT, dockerBinary string, dockerdBinary string, ops ...func(*daemon.Daemon)) *Daemon {
ops = append(ops, daemon.WithDockerdBinary(dockerdBinary))
if config.Experimental {
ops = append(ops, daemon.WithExperimental)
}
d := daemon.New(t, ops...)
return &Daemon{
Daemon: d,
dockerBinary: dockerBinary,