Merge pull request #1797 from jessvalarezo/rename-packages

rename snapshot->snapshots packages, add aliases
This commit is contained in:
Derek McGowan
2017-11-29 17:53:11 -08:00
committed by GitHub
50 changed files with 508 additions and 503 deletions

View File

@@ -13,7 +13,7 @@ import (
_ "github.com/containerd/containerd/services/introspection"
_ "github.com/containerd/containerd/services/leases"
_ "github.com/containerd/containerd/services/namespaces"
_ "github.com/containerd/containerd/services/snapshot"
_ "github.com/containerd/containerd/services/snapshots"
_ "github.com/containerd/containerd/services/tasks"
_ "github.com/containerd/containerd/services/version"
)

View File

@@ -2,4 +2,4 @@
package main
import _ "github.com/containerd/containerd/snapshot/btrfs"
import _ "github.com/containerd/containerd/snapshots/btrfs"

View File

@@ -3,5 +3,5 @@ package main
import (
_ "github.com/containerd/containerd/linux"
_ "github.com/containerd/containerd/metrics/cgroups"
_ "github.com/containerd/containerd/snapshot/overlay"
_ "github.com/containerd/containerd/snapshots/overlay"
)

View File

@@ -3,5 +3,5 @@
package main
import (
_ "github.com/containerd/containerd/snapshot/naive"
_ "github.com/containerd/containerd/snapshots/naive"
)

View File

@@ -1,6 +1,6 @@
package main
import (
_ "github.com/containerd/containerd/snapshot/windows"
_ "github.com/containerd/containerd/snapshots/windows"
_ "github.com/containerd/containerd/windows"
)

View File

@@ -18,7 +18,7 @@ import (
var Command = cli.Command{
Name: "containers",
Usage: "manage containers",
Aliases: []string{"c"},
Aliases: []string{"c", "container"},
Subcommands: []cli.Command{
deleteCommand,
infoCommand,

View File

@@ -15,8 +15,9 @@ import (
// Command is the cli command for displaying containerd events
var Command = cli.Command{
Name: "events",
Usage: "display containerd events",
Name: "events",
Aliases: []string{"event"},
Usage: "display containerd events",
Action: func(context *cli.Context) error {
client, ctx, cancel, err := commands.NewClient(context)
if err != nil {

View File

@@ -19,8 +19,9 @@ import (
// Command is the cli command for managing images
var Command = cli.Command{
Name: "images",
Usage: "manage images",
Name: "images",
Aliases: []string{"image"},
Usage: "manage images",
Subcommands: cli.Commands{
checkCommand,
exportCommand,

View File

@@ -16,8 +16,9 @@ import (
// Command is the cli command for managing namespaces
var Command = cli.Command{
Name: "namespaces",
Usage: "manage namespaces",
Name: "namespaces",
Aliases: []string{"namespace"},
Usage: "manage namespaces",
Subcommands: cli.Commands{
createCommand,
listCommand,

View File

@@ -18,8 +18,9 @@ import (
// Command is a cli command that outputs plugin information
var Command = cli.Command{
Name: "plugins",
Usage: "provides information about containerd plugins",
Name: "plugins",
Aliases: []string{"plugin"},
Usage: "provides information about containerd plugins",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "quiet,q",

View File

@@ -1,4 +1,4 @@
package snapshot
package snapshots
import (
gocontext "context"
@@ -11,7 +11,7 @@ import (
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/progress"
"github.com/containerd/containerd/snapshot"
"github.com/containerd/containerd/snapshots"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
"github.com/urfave/cli"
@@ -19,9 +19,10 @@ import (
// Command is the cli command for managing snapshots
var Command = cli.Command{
Name: "snapshot",
Usage: "manage snapshots",
Flags: commands.SnapshotterFlags,
Name: "snapshots",
Aliases: []string{"snapshot"},
Usage: "manage snapshots",
Flags: commands.SnapshotterFlags,
Subcommands: cli.Commands{
commitCommand,
infoCommand,
@@ -52,7 +53,7 @@ var listCommand = cli.Command{
tw = tabwriter.NewWriter(os.Stdout, 1, 8, 1, ' ', 0)
)
fmt.Fprintln(tw, "KEY\tPARENT\tKIND\t")
if err := snapshotter.Walk(ctx, func(ctx gocontext.Context, info snapshot.Info) error {
if err := snapshotter.Walk(ctx, func(ctx gocontext.Context, info snapshots.Info) error {
fmt.Fprintf(tw, "%v\t%v\t%v\t\n",
info.Name,
info.Parent,
@@ -98,7 +99,7 @@ var usageCommand = cli.Command{
)
fmt.Fprintln(tw, "KEY\tSIZE\tINODES\t")
if context.NArg() == 0 {
if err := snapshotter.Walk(ctx, func(ctx gocontext.Context, info snapshot.Info) error {
if err := snapshotter.Walk(ctx, func(ctx gocontext.Context, info snapshots.Info) error {
usage, err := snapshotter.Usage(ctx, info.Name)
if err != nil {
return err
@@ -289,7 +290,7 @@ var treeCommand = cli.Command{
tree = make(map[string]*snapshotTreeNode)
)
if err := snapshotter.Walk(ctx, func(ctx gocontext.Context, info snapshot.Info) error {
if err := snapshotter.Walk(ctx, func(ctx gocontext.Context, info snapshots.Info) error {
// Get or create node and add node details
node := getOrCreateTreeNode(info.Name, tree)
if info.Parent != "" {
@@ -351,7 +352,7 @@ var setLabelCommand = cli.Command{
snapshotter := client.SnapshotService(context.GlobalString("snapshotter"))
info := snapshot.Info{
info := snapshots.Info{
Name: key,
Labels: map[string]string{},
}

View File

@@ -14,7 +14,7 @@ type resizer interface {
var Command = cli.Command{
Name: "tasks",
Usage: "manage tasks",
Aliases: []string{"t"},
Aliases: []string{"t", "task"},
Subcommands: []cli.Command{
attachCommand,
checkpointCommand,

View File

@@ -14,7 +14,7 @@ import (
"github.com/containerd/containerd/cmd/ctr/commands/plugins"
"github.com/containerd/containerd/cmd/ctr/commands/pprof"
"github.com/containerd/containerd/cmd/ctr/commands/run"
"github.com/containerd/containerd/cmd/ctr/commands/snapshot"
"github.com/containerd/containerd/cmd/ctr/commands/snapshots"
"github.com/containerd/containerd/cmd/ctr/commands/tasks"
versionCmd "github.com/containerd/containerd/cmd/ctr/commands/version"
"github.com/containerd/containerd/defaults"
@@ -84,7 +84,7 @@ containerd CLI
namespacesCmd.Command,
pprof.Command,
run.Command,
snapshot.Command,
snapshots.Command,
tasks.Command,
}, extraCmds...)
app.Before = func(context *cli.Context) error {