@@ -67,8 +67,7 @@ func (d *Daemon) CheckServiceUpdateState(service string) func(*check.C) (interfa
6767// CheckPluginRunning returns the runtime state of the plugin
6868func (d * Daemon ) CheckPluginRunning (plugin string ) func (c * check.C ) (interface {}, check.CommentInterface ) {
6969 return func (c * check.C ) (interface {}, check.CommentInterface ) {
70- apiclient , err := d .NewClient ()
71- assert .NilError (c , err )
70+ apiclient := d .NewClientT (c )
7271 resp , _ , err := apiclient .PluginInspectWithRaw (context .Background (), plugin )
7372 if client .IsErrNotFound (err ) {
7473 return false , check .Commentf ("%v" , err )
@@ -81,8 +80,7 @@ func (d *Daemon) CheckPluginRunning(plugin string) func(c *check.C) (interface{}
8180// CheckPluginImage returns the runtime state of the plugin
8281func (d * Daemon ) CheckPluginImage (plugin string ) func (c * check.C ) (interface {}, check.CommentInterface ) {
8382 return func (c * check.C ) (interface {}, check.CommentInterface ) {
84- apiclient , err := d .NewClient ()
85- assert .NilError (c , err )
83+ apiclient := d .NewClientT (c )
8684 resp , _ , err := apiclient .PluginInspectWithRaw (context .Background (), plugin )
8785 if client .IsErrNotFound (err ) {
8886 return false , check .Commentf ("%v" , err )
@@ -102,8 +100,7 @@ func (d *Daemon) CheckServiceTasks(service string) func(*check.C) (interface{},
102100
103101// CheckRunningTaskNetworks returns the number of times each network is referenced from a task.
104102func (d * Daemon ) CheckRunningTaskNetworks (c * check.C ) (interface {}, check.CommentInterface ) {
105- cli , err := d .NewClient ()
106- c .Assert (err , checker .IsNil )
103+ cli := d .NewClientT (c )
107104 defer cli .Close ()
108105
109106 filterArgs := filters .NewArgs ()
@@ -127,8 +124,7 @@ func (d *Daemon) CheckRunningTaskNetworks(c *check.C) (interface{}, check.Commen
127124
128125// CheckRunningTaskImages returns the times each image is running as a task.
129126func (d * Daemon ) CheckRunningTaskImages (c * check.C ) (interface {}, check.CommentInterface ) {
130- cli , err := d .NewClient ()
131- c .Assert (err , checker .IsNil )
127+ cli := d .NewClientT (c )
132128 defer cli .Close ()
133129
134130 filterArgs := filters .NewArgs ()
@@ -177,8 +173,7 @@ func (d *Daemon) CheckControlAvailable(c *check.C) (interface{}, check.CommentIn
177173
178174// CheckLeader returns whether there is a leader on the swarm or not
179175func (d * Daemon ) CheckLeader (c * check.C ) (interface {}, check.CommentInterface ) {
180- cli , err := d .NewClient ()
181- c .Assert (err , checker .IsNil )
176+ cli := d .NewClientT (c )
182177 defer cli .Close ()
183178
184179 errList := check .Commentf ("could not get node list" )
0 commit comments