Skip to content

Rename sandbox to podsandbox. #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: "SANDBOX container-config.[json|yaml] sandbox-config.[json|yaml]",
ArgsUsage: "PODSANDBOX container-config.[json|yaml] podsandbox-config.[json|yaml]",
Flags: []cli.Flag{},
Action: func(context *cli.Context) error {
if len(context.Args()) != 3 {
Expand Down Expand Up @@ -259,9 +259,9 @@ var listContainersCommand = cli.Command{
Usage: "Filter by container id",
},
cli.StringFlag{
Name: "sandbox",
Name: "podsandbox, p",
Value: "",
Usage: "Filter by sandbox id",
Usage: "Filter by pod sandbox id",
},
cli.StringFlag{
Name: "state",
Expand Down Expand Up @@ -305,7 +305,7 @@ var listContainersCommand = cli.Command{

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

fmt.Printf("ID: %s\n", c.Id)
fmt.Printf("SandboxID: %s\n", c.PodSandboxId)
fmt.Printf("PodSandboxID: %s\n", c.PodSandboxId)
if c.Metadata != nil {
if c.Metadata.Name != "" {
fmt.Printf("Name: %s\n", c.Metadata.Name)
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 sandbox",
ArgsUsage: "SANDBOX [LOCAL_PORT:]REMOTE_PORT",
Usage: "Forward local port to a pod sandbox",
ArgsUsage: "PODSANDBOX [LOCAL_PORT:]REMOTE_PORT",
Action: func(context *cli.Context) error {
args := context.Args()
if len(args) < 2 {
Expand Down
38 changes: 19 additions & 19 deletions cmd/crictl/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func (a sandboxByCreated) Less(i, j int) bool {
}

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

var stopPodSandboxCommand = cli.Command{
Name: "stops",
Usage: "Stop a running sandbox",
ArgsUsage: "SANDBOX",
Name: "stopp",
Usage: "Stop a running pod sandbox",
ArgsUsage: "PODSANDBOX",
Action: func(context *cli.Context) error {
id := context.Args().First()
if id == "" {
Expand All @@ -93,9 +93,9 @@ var stopPodSandboxCommand = cli.Command{
}

var removePodSandboxCommand = cli.Command{
Name: "rms",
Usage: "Remove a sandbox",
ArgsUsage: "SANDBOX",
Name: "rmp",
Usage: "Remove a pod sandbox",
ArgsUsage: "PODSANDBOX",
Action: func(context *cli.Context) error {
id := context.Args().First()
if id == "" {
Expand All @@ -115,9 +115,9 @@ var removePodSandboxCommand = cli.Command{
}

var podSandboxStatusCommand = cli.Command{
Name: "inspects",
Usage: "Display the status of a sandbox",
ArgsUsage: "SANDBOX",
Name: "inspectp",
Usage: "Display the status of a pod sandbox",
ArgsUsage: "PODSANDBOX",
Flags: []cli.Flag{
cli.StringFlag{
Name: "output, o",
Expand Down Expand Up @@ -147,8 +147,8 @@ var podSandboxStatusCommand = cli.Command{
}

var listPodSandboxCommand = cli.Command{
Name: "sandboxes",
Usage: "List sandboxes",
Name: "pods",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pods -> podsandboxes ?

Copy link
Contributor Author

@Random-Liu Random-Liu Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command will be frequently used, I feel like podsandboxes is too long, which will be very annoying in the future. :P
That's why I use crictl pods for this command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pods looks more simple

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. :-)

Usage: "List pod sandboxes",
Flags: []cli.Flag{
cli.StringFlag{
Name: "id",
Expand Down Expand Up @@ -176,23 +176,23 @@ var listPodSandboxCommand = cli.Command{
},
cli.BoolFlag{
Name: "verbose, v",
Usage: "show verbose info for sandboxes",
Usage: "show verbose info for pod sandboxes",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "list only sandbox IDs",
Usage: "list only pod sandbox IDs",
},
cli.StringFlag{
Name: "output, o",
Usage: "Output format, One of: json|yaml|table",
},
cli.BoolFlag{
Name: "latest, l",
Usage: "Show recently created sandboxes",
Usage: "Show recently created pod sandboxes",
},
cli.IntFlag{
Name: "last, n",
Usage: "Show last n recently created sandboxes",
Usage: "Show last n recently created pod sandboxes",
},
cli.BoolFlag{
Name: "no-trunc",
Expand Down Expand Up @@ -416,7 +416,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, "SANDBOX ID\tCREATED\tSTATE\tNAME\tNAMESPACE\tATTEMPT")
fmt.Fprintln(w, "PODSANDBOX 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: "sandbox",
Name: "podsandbox, p",
Value: "",
Usage: "Filter by sandbox id",
Usage: "Filter by pod sandbox 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("sandbox"),
podID: context.String("podsandbox"),
sample: time.Duration(context.Int("seconds")) * time.Second,
output: context.String("output"),
}
Expand Down
28 changes: 14 additions & 14 deletions docs/crictl.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ crictl SUBCOMMAND [FLAGS]
Subcommands includes:

- `info`: Display runtime version information
- `runs`: Run a new sandbox
- `stops`: Stop a running sandbox
- `rms`: Remove a sandbox
- `inspects`: Display the status of a sandbox
- `sandboxes`: List sandboxes
- `runp`: Run a new pod sandbox
- `stopp`: Stop a running pod sandbox
- `rmp`: Remove a pod sandbox
- `inspectp`: Display the status of a pod sandbox
- `pods`: List pod sandboxes
- `create`: Create a new container
- `start`: Start a created container
- `stop`: Stop a running container
Expand All @@ -43,7 +43,7 @@ Subcommands includes:
- `inspecti`: Return the status of an image
- `rmi`: Remove an image
- `exec`: Run a command in a running container
- `port-forward`: Forward local port to a sandbox
- `port-forward`: Forward local port to a pod sandbox
- `logs`: Fetch the logs of a container
- `help`: Shows a list of commands or help for one command

Expand Down Expand Up @@ -73,10 +73,10 @@ debug: true

## Examples

### Run sandbox with config file
### Run pod sandbox with config file

```
# cat sandbox-config.json
# cat podsandbox-config.json
{
"metadata": {
"name": "nginx-sandbox",
Expand All @@ -88,10 +88,10 @@ debug: true
}
}

# crictl runs sandbox-config.json
# crictl runp podsandbox-config.json
e1c83b0b8d481d4af8ba98d5f7812577fc175a37b10dc824335951f52addbb4e
# crictl sandboxes
SANDBOX ID NAME STATE
# crictl pods
PODSANDBOX ID NAME STATE
e1c83b0b8d481d4af8ba98d5f7812577fc175a37b10dc824335951f52addbb4e nginx-sandbox SANDBOX_READY
```

Expand All @@ -106,10 +106,10 @@ busybox latest d20ae45477cbc 1
gcr.io/google_containers/pause-amd64 3.0 99e59f495ffaa 747kB
```

### Create container in a sandbox with config file
### Create container in a pod sandbox with config file

```
# cat sandbox-config.json
# cat podsandbox-config.json
{
"metadata": {
"name": "nginx-sandbox",
Expand All @@ -136,7 +136,7 @@ gcr.io/google_containers/pause-amd64 3.0 99e59f495ffaa 7
}
}

# crictl create e1c83b0b8d481d4af8ba98d5f7812577fc175a37b10dc824335951f52addbb4e container-config.json sandbox-config.json
# crictl create e1c83b0b8d481d4af8ba98d5f7812577fc175a37b10dc824335951f52addbb4e container-config.json podsandbox-config.json
0a2c761303163f2acaaeaee07d2ba143ee4cea7e3bde3d32190e2a36525c8a05
# crictl ps
CONTAINER ID CREATED STATE NAME
Expand Down
File renamed without changes.
File renamed without changes.