Modify kpod diff --json to --format json
We want all kpod subcommands to use the formats code to output formats like json. Altering kpod diff --json to kpod diff --format json like the kpod images command. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
parent
f82fe5691a
commit
78c6151519
13 changed files with 267 additions and 237 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
js "encoding/json"
|
||||
"fmt"
|
||||
|
||||
of "github.com/kubernetes-incubator/cri-o/cmd/kpod/formats"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
@ -28,7 +29,7 @@ var (
|
|||
},
|
||||
cli.StringFlag{
|
||||
Name: "format",
|
||||
Usage: "Print mounted containers in specified format",
|
||||
Usage: "Change the output format to Go template",
|
||||
},
|
||||
}
|
||||
mountCommand = cli.Command{
|
||||
|
@ -55,7 +56,7 @@ func mountCmd(c *cli.Context) error {
|
|||
}
|
||||
|
||||
args := c.Args()
|
||||
json := c.String("format") == "json"
|
||||
json := c.String("format") == of.JSONString
|
||||
if !formats[c.String("format")] {
|
||||
return errors.Errorf("%q is not a supported format", c.String("format"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue