소스 검색

testutil: update WithInitsignature to be a daemon.Option

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 년 전
부모
커밋
f60d6ee4bc
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  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