Skip to content

Commit

Permalink
adding verbose output switch for inspect
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
  • Loading branch information
mikebrow committed Nov 29, 2017
1 parent 80a7c13 commit 5ff2724
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/crictl/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ var containerStatusCommand = cli.Command{
Name: "output, o",
Usage: "Output format, One of: json|yaml|table",
},
cli.BoolFlag{
Name: "verbose, v",
Usage: "Show verbose information",
},
},
Action: func(context *cli.Context) error {
containerID := context.Args().First()
Expand All @@ -232,7 +236,7 @@ var containerStatusCommand = cli.Command{
return err
}

err := ContainerStatus(runtimeClient, containerID, context.String("output"))
err := ContainerStatus(runtimeClient, containerID, context.String("output"), context.Bool("verbose"))
if err != nil {
return fmt.Errorf("Getting the status of the container failed: %v", err)
}
Expand Down Expand Up @@ -462,12 +466,13 @@ func RemoveContainer(client pb.RuntimeServiceClient, ID string) error {

// ContainerStatus sends a ContainerStatusRequest to the server, and parses
// the returned ContainerStatusResponse.
func ContainerStatus(client pb.RuntimeServiceClient, ID, output string) error {
func ContainerStatus(client pb.RuntimeServiceClient, ID, output string, verbose bool) error {
if ID == "" {
return fmt.Errorf("ID cannot be empty")
}
request := &pb.ContainerStatusRequest{
ContainerId: ID,
Verbose: verbose,
}
logrus.Debugf("ContainerStatusRequest: %v", request)
r, err := client.ContainerStatus(context.Background(), request)
Expand Down

0 comments on commit 5ff2724

Please sign in to comment.