From 13fd708f04e8c25633e95054520f8ceab890f9b2 Mon Sep 17 00:00:00 2001 From: CuiHaozhi Date: Fri, 21 Jul 2017 09:48:22 -0400 Subject: [PATCH] crioctl ctr stop: enable timeout input Signed-off-by: CuiHaozhi --- cmd/crioctl/container.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/crioctl/container.go b/cmd/crioctl/container.go index 86b96d43..567807f6 100644 --- a/cmd/crioctl/container.go +++ b/cmd/crioctl/container.go @@ -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) }