Merge pull request #686 from sak0/dev
crioctl ctr stop: enable timeout input
This commit is contained in:
commit
1aa0d5da86
1 changed files with 6 additions and 1 deletions
|
@ -138,6 +138,11 @@ var stopContainerCommand = cli.Command{
|
|||
Value: "",
|
||||
Usage: "id of the container",
|
||||
},
|
||||
cli.Int64Flag{
|
||||
Name: "timeout",
|
||||
Value: 10,
|
||||
Usage: "seconds to wait to kill the container after a graceful stop is requested",
|
||||
},
|
||||
},
|
||||
Action: func(context *cli.Context) error {
|
||||
// Set up a connection to the server.
|
||||
|
@ -148,7 +153,7 @@ var stopContainerCommand = cli.Command{
|
|||
defer conn.Close()
|
||||
client := pb.NewRuntimeServiceClient(conn)
|
||||
|
||||
err = StopContainer(client, context.String("id"), -1)
|
||||
err = StopContainer(client, context.String("id"), context.Int64("timeout"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("Stopping the container failed: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue