Bläddra i källkod

testutil: update WithInitsignature to be a daemon.Option

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 år sedan
förälder
incheckning
f60d6ee4bc
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. 1 1
      integration/service/create_test.go
  2. 4 2
      testutil/daemon/ops.go

+ 1 - 1
integration/service/create_test.go

@@ -33,7 +33,7 @@ func testServiceCreateInit(daemonEnabled bool) func(t *testing.T) {
 		var ops = []daemon.Option{}
 
 		if daemonEnabled {
-			ops = append(ops, daemon.WithInit)
+			ops = append(ops, daemon.WithInit())
 		}
 		d := swarm.NewSwarm(t, testEnv, ops...)
 		defer d.Stop(t)

+ 4 - 2
testutil/daemon/ops.go

@@ -31,8 +31,10 @@ func WithExperimental() Option {
 }
 
 // WithInit sets the daemon init
-func WithInit(d *Daemon) {
-	d.init = true
+func WithInit() Option {
+	return func(d *Daemon) {
+		d.init = true
+	}
 }
 
 // WithDockerdBinary sets the dockerd binary to the specified one