@@ -155,7 +155,7 @@ func EnsureMongoIsRunning(ctx context.Context, c *portercontext.Context, contain
155
155
err = exec .Command ("docker" , "volume" , "create" , dataVol ).Run ()
156
156
if err != nil {
157
157
if exitErr , ok := err .(* exec.ExitError ); ok {
158
- err = fmt .Errorf (string (exitErr .Stderr ))
158
+ err = fmt .Errorf ("%s" , string (exitErr .Stderr ))
159
159
}
160
160
return nil , span .Error (fmt .Errorf ("error creating %s docker volume: %w" , dataVol , err ))
161
161
}
@@ -170,7 +170,7 @@ func EnsureMongoIsRunning(ctx context.Context, c *portercontext.Context, contain
170
170
err := exec .Command ("docker" , "pull" , mongoImg ).Run ()
171
171
if err != nil {
172
172
if exitErr , ok := err .(* exec.ExitError ); ok {
173
- err = fmt .Errorf (string (exitErr .Stderr ))
173
+ err = fmt .Errorf ("%s" , string (exitErr .Stderr ))
174
174
}
175
175
return span .Error (fmt .Errorf ("error pulling %s: %w" , mongoImg , err ))
176
176
}
@@ -186,7 +186,7 @@ func EnsureMongoIsRunning(ctx context.Context, c *portercontext.Context, contain
186
186
err = mongoC .Start ()
187
187
if err != nil {
188
188
if exitErr , ok := err .(* exec.ExitError ); ok {
189
- err = fmt .Errorf (string (exitErr .Stderr ))
189
+ err = fmt .Errorf ("%s" , string (exitErr .Stderr ))
190
190
}
191
191
return span .Error (fmt .Errorf ("error running a mongo container for the mongodb-docker plugin: %w" , err ))
192
192
}
@@ -200,15 +200,15 @@ func EnsureMongoIsRunning(ctx context.Context, c *portercontext.Context, contain
200
200
}
201
201
} else {
202
202
if exitErr , ok := err .(* exec.ExitError ); ok {
203
- err = fmt .Errorf (string (exitErr .Stderr ))
203
+ err = fmt .Errorf ("%s" , string (exitErr .Stderr ))
204
204
}
205
205
return nil , span .Error (fmt .Errorf ("error inspecting container %s: %w" , container , err ))
206
206
}
207
207
} else if ! strings .Contains (string (containerStatus ), `"Status": "running"` ) { // Container is stopped
208
208
err = exec .Command ("docker" , "rm" , "-f" , container ).Run ()
209
209
if err != nil {
210
210
if exitErr , ok := err .(* exec.ExitError ); ok {
211
- err = fmt .Errorf (string (exitErr .Stderr ))
211
+ err = fmt .Errorf ("%s" , string (exitErr .Stderr ))
212
212
}
213
213
return nil , span .Error (fmt .Errorf ("error cleaning up stopped container %s: %w" , container , err ))
214
214
}
0 commit comments