Skip to content

Commit

Permalink
Merge pull request #278 from Random-Liu/remove-sandbox-from-description
Browse files Browse the repository at this point in the history
Remove sandbox from user facing descriptions.
  • Loading branch information
feiskyer authored Mar 29, 2018
2 parents 7962f60 + 8611cfe commit d127846
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
10 changes: 5 additions & 5 deletions cmd/crictl/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type createOptions struct {
var createContainerCommand = cli.Command{
Name: "create",
Usage: "Create a new container",
ArgsUsage: "PODSANDBOX container-config.[json|yaml] podsandbox-config.[json|yaml]",
ArgsUsage: "POD container-config.[json|yaml] pod-config.[json|yaml]",
Flags: []cli.Flag{},
Action: func(context *cli.Context) error {
if len(context.Args()) != 3 {
Expand Down Expand Up @@ -264,9 +264,9 @@ var listContainersCommand = cli.Command{
Usage: "Filter by container id",
},
cli.StringFlag{
Name: "podsandbox, p",
Name: "pod, p",
Value: "",
Usage: "Filter by pod sandbox id",
Usage: "Filter by pod id",
},
cli.StringFlag{
Name: "state",
Expand Down Expand Up @@ -310,7 +310,7 @@ var listContainersCommand = cli.Command{

opts := listOptions{
id: context.String("id"),
podID: context.String("podsandbox"),
podID: context.String("pod"),
state: context.String("state"),
verbose: context.Bool("verbose"),
quiet: context.Bool("quiet"),
Expand Down Expand Up @@ -630,7 +630,7 @@ func ListContainers(client pb.RuntimeServiceClient, opts listOptions) error {
}

fmt.Printf("ID: %s\n", c.Id)
fmt.Printf("PodSandboxID: %s\n", c.PodSandboxId)
fmt.Printf("PodID: %s\n", c.PodSandboxId)
if c.Metadata != nil {
if c.Metadata.Name != "" {
fmt.Printf("Name: %s\n", c.Metadata.Name)
Expand Down
10 changes: 5 additions & 5 deletions cmd/crictl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,20 @@ func main() {
listImageCommand,
containerStatusCommand,
imageStatusCommand,
podSandboxStatusCommand,
podStatusCommand,
logsCommand,
runtimePortForwardCommand,
listContainersCommand,
pullImageCommand,
runPodSandboxCommand,
runPodCommand,
removeContainerCommand,
removeImageCommand,
removePodSandboxCommand,
listPodSandboxCommand,
removePodCommand,
listPodCommand,
startContainerCommand,
runtimeStatusCommand,
stopContainerCommand,
stopPodSandboxCommand,
stopPodCommand,
updateContainerCommand,
configCommand,
statsCommand,
Expand Down
4 changes: 2 additions & 2 deletions cmd/crictl/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (

var runtimePortForwardCommand = cli.Command{
Name: "port-forward",
Usage: "Forward local port to a pod sandbox",
ArgsUsage: "PODSANDBOX [LOCAL_PORT:]REMOTE_PORT",
Usage: "Forward local port to a pod",
ArgsUsage: "POD [LOCAL_PORT:]REMOTE_PORT",
Action: func(context *cli.Context) error {
args := context.Args()
if len(args) < 2 {
Expand Down
46 changes: 23 additions & 23 deletions cmd/crictl/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func (a sandboxByCreated) Less(i, j int) bool {
return a[i].CreatedAt > a[j].CreatedAt
}

var runPodSandboxCommand = cli.Command{
var runPodCommand = cli.Command{
Name: "runp",
Usage: "Run a new pod sandbox",
ArgsUsage: "podsandbox-config.[json|yaml]",
Usage: "Run a new pod",
ArgsUsage: "pod-config.[json|yaml]",
Action: func(context *cli.Context) error {
sandboxSpec := context.Args().First()
if sandboxSpec == "" {
Expand All @@ -70,10 +70,10 @@ var runPodSandboxCommand = cli.Command{
},
}

var stopPodSandboxCommand = cli.Command{
var stopPodCommand = cli.Command{
Name: "stopp",
Usage: "Stop one or more running pod sandboxes",
ArgsUsage: "PODSANDBOX [PODSANDBOX...]",
Usage: "Stop one or more running pods",
ArgsUsage: "POD [POD...]",
Action: func(context *cli.Context) error {
if context.NArg() == 0 {
return cli.ShowSubcommandHelp(context)
Expand All @@ -92,10 +92,10 @@ var stopPodSandboxCommand = cli.Command{
},
}

var removePodSandboxCommand = cli.Command{
var removePodCommand = cli.Command{
Name: "rmp",
Usage: "Remove one or more pod sandboxes",
ArgsUsage: "PODSANDBOX [PODSANDBOX...]",
Usage: "Remove one or more pods",
ArgsUsage: "POD [POD...]",
Action: func(context *cli.Context) error {
if context.NArg() == 0 {
return cli.ShowSubcommandHelp(context)
Expand All @@ -114,10 +114,10 @@ var removePodSandboxCommand = cli.Command{
},
}

var podSandboxStatusCommand = cli.Command{
var podStatusCommand = cli.Command{
Name: "inspectp",
Usage: "Display the status of one or more pod sandboxes",
ArgsUsage: "PODSANDBOX [PODSANDBOX...]",
Usage: "Display the status of one or more pods",
ArgsUsage: "POD [POD...]",
Flags: []cli.Flag{
cli.StringFlag{
Name: "output, o",
Expand Down Expand Up @@ -147,53 +147,53 @@ var podSandboxStatusCommand = cli.Command{
},
}

var listPodSandboxCommand = cli.Command{
var listPodCommand = cli.Command{
Name: "pods",
Usage: "List pod sandboxes",
Usage: "List pods",
Flags: []cli.Flag{
cli.StringFlag{
Name: "id",
Value: "",
Usage: "filter by pod sandbox id",
Usage: "filter by pod id",
},
cli.StringFlag{
Name: "name",
Value: "",
Usage: "filter by pod sandbox name",
Usage: "filter by pod name",
},
cli.StringFlag{
Name: "namespace",
Value: "",
Usage: "filter by pod sandbox namespace",
Usage: "filter by pod namespace",
},
cli.StringFlag{
Name: "state, s",
Value: "",
Usage: "filter by pod sandbox state",
Usage: "filter by pod state",
},
cli.StringSliceFlag{
Name: "label",
Usage: "filter by key=value label",
},
cli.BoolFlag{
Name: "verbose, v",
Usage: "show verbose info for pod sandboxes",
Usage: "show verbose info for pods",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "list only pod sandbox IDs",
Usage: "list only pod IDs",
},
cli.StringFlag{
Name: "output, o",
Usage: "Output format, One of: json|yaml|table",
},
cli.BoolFlag{
Name: "latest, l",
Usage: "Show recently created pod sandboxes",
Usage: "Show recently created pods",
},
cli.IntFlag{
Name: "last, n",
Usage: "Show last n recently created pod sandboxes",
Usage: "Show last n recently created pods",
},
cli.BoolFlag{
Name: "no-trunc",
Expand Down Expand Up @@ -417,7 +417,7 @@ func ListPodSandboxes(client pb.RuntimeServiceClient, opts listOptions) error {

w := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0)
if !opts.verbose && !opts.quiet {
fmt.Fprintln(w, "PODSANDBOX ID\tCREATED\tSTATE\tNAME\tNAMESPACE\tATTEMPT")
fmt.Fprintln(w, "POD ID\tCREATED\tSTATE\tNAME\tNAMESPACE\tATTEMPT")
}
for _, pod := range r.Items {
if opts.quiet {
Expand Down
6 changes: 3 additions & 3 deletions cmd/crictl/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ var statsCommand = cli.Command{
Usage: "Filter by container id",
},
cli.StringFlag{
Name: "podsandbox, p",
Name: "pod, p",
Value: "",
Usage: "Filter by pod sandbox id",
Usage: "Filter by pod id",
},
cli.StringSliceFlag{
Name: "label",
Expand All @@ -88,7 +88,7 @@ var statsCommand = cli.Command{
opts := statsOptions{
all: context.Bool("all"),
id: context.String("id"),
podID: context.String("podsandbox"),
podID: context.String("pod"),
sample: time.Duration(context.Int("seconds")) * time.Second,
output: context.String("output"),
}
Expand Down

0 comments on commit d127846

Please sign in to comment.