()
| 486 | } |
| 487 | |
| 488 | func (d *dockerRunnable) Kill() error { |
| 489 | if !d.IsRunning() { |
| 490 | return nil |
| 491 | } |
| 492 | |
| 493 | d.logger.Log("Killing", d.Name()) |
| 494 | |
| 495 | if out, err := d.env.exec("docker", "kill", d.containerName()).CombinedOutput(); err != nil { |
| 496 | d.logger.Log(string(out)) |
| 497 | return err |
| 498 | } |
| 499 | |
| 500 | // Wait until the container actually stopped. However, this could fail if |
| 501 | // the container already exited, so we just ignore the error. |
| 502 | _, _ = d.env.exec("docker", "wait", d.containerName()).CombinedOutput() |
| 503 | |
| 504 | d.usedNetworkName = "" |
| 505 | return d.env.registerStopped(d.Name()) |
| 506 | } |
| 507 | |
| 508 | // Endpoint returns external (from host perspective) service endpoint (host:port) for given port name. |
| 509 | // External means that it will be accessible only from host, but not from docker containers. |
nothing calls this directly
no test coverage detected