mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Don't log an error when stopping the container if it is not running.
This removes a lot of confusing messages from the test logs. PiperOrigin-RevId: 266164001
This commit is contained in:
@@ -297,7 +297,11 @@ func (d *Docker) Remove() error {
|
||||
func (d *Docker) CleanUp() {
|
||||
d.logDockerID()
|
||||
if _, err := do("kill", d.Name); err != nil {
|
||||
log.Printf("error killing container %q: %v", d.Name, err)
|
||||
if strings.Contains(err.Error(), "is not running") {
|
||||
// Nothing to kill. Don't log the error in this case.
|
||||
} else {
|
||||
log.Printf("error killing container %q: %v", d.Name, err)
|
||||
}
|
||||
}
|
||||
if err := d.Remove(); err != nil {
|
||||
log.Print(err)
|
||||
|
||||
Reference in New Issue
Block a user