Add StopWithTimeout API function for containers

Normal Stop should not need a timeout, and should use the default
Add a function that does accept a timeout aside it

Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #272
Approved by: rhatdan
This commit is contained in:
Matthew Heon
2018-01-29 11:59:33 -05:00
committed by Atomic Bot
parent dd133a1ad2
commit c60d8a0671
4 changed files with 43 additions and 21 deletions

View File

@@ -101,7 +101,7 @@ func stopCmd(c *cli.Context) error {
} else {
stopTimeout = ctr.StopTimeout()
}
if err := ctr.Stop(stopTimeout); err != nil {
if err := ctr.StopWithTimeout(stopTimeout); err != nil {
if lastError != nil {
fmt.Fprintln(os.Stderr, lastError)
}