ctr: move images command
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
This commit is contained in:
parent
47fae4dd17
commit
f980cc197e
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package images
|
||||
|
||||
import (
|
||||
"io"
|
||||
@ -12,11 +12,11 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
var imagesExportCommand = cli.Command{
|
||||
var exportCommand = cli.Command{
|
||||
Name: "export",
|
||||
Usage: "export an image",
|
||||
ArgsUsage: "[flags] <out> <image>",
|
||||
Description: `Export an image to a tar stream.`,
|
||||
Description: "export an image to a tar stream",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "oci-ref-name",
|
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package images
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@ -17,25 +17,26 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
var imageCommand = cli.Command{
|
||||
// Command is the cli command for managing images
|
||||
var Command = cli.Command{
|
||||
Name: "images",
|
||||
Usage: "manage images",
|
||||
Subcommands: cli.Commands{
|
||||
imagesListCommand,
|
||||
imagesCheckCommand,
|
||||
imageRemoveCommand,
|
||||
imagesSetLabelsCommand,
|
||||
imagesImportCommand,
|
||||
imagesExportCommand,
|
||||
listCommand,
|
||||
checkCommand,
|
||||
removeCommand,
|
||||
setLabelsCommand,
|
||||
importCommand,
|
||||
exportCommand,
|
||||
},
|
||||
}
|
||||
|
||||
var imagesListCommand = cli.Command{
|
||||
var listCommand = cli.Command{
|
||||
Name: "list",
|
||||
Aliases: []string{"ls"},
|
||||
Usage: "list images known to containerd",
|
||||
ArgsUsage: "[flags] <ref>",
|
||||
Description: `List images registered with containerd.`,
|
||||
Description: "list images registered with containerd",
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
Name: "quiet, q",
|
||||
@ -114,11 +115,11 @@ var imagesListCommand = cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
var imagesSetLabelsCommand = cli.Command{
|
||||
var setLabelsCommand = cli.Command{
|
||||
Name: "label",
|
||||
Usage: "set and clear labels for an image.",
|
||||
Usage: "set and clear labels for an image",
|
||||
ArgsUsage: "[flags] <name> [<key>=<value>, ...]",
|
||||
Description: "Set and clear labels for an image.",
|
||||
Description: "set and clear labels for an image",
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
Name: "replace-all, r",
|
||||
@ -173,12 +174,11 @@ var imagesSetLabelsCommand = cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
var imagesCheckCommand = cli.Command{
|
||||
var checkCommand = cli.Command{
|
||||
Name: "check",
|
||||
Usage: "Check that an image has all content available locally.",
|
||||
ArgsUsage: "[flags] <ref> [<ref>, ...]",
|
||||
Description: "Check that an image has all content available locally.",
|
||||
Flags: []cli.Flag{},
|
||||
Usage: "check that an image has all content available locally",
|
||||
ArgsUsage: "<ref> [<ref>, ...]",
|
||||
Description: "check that an image has all content available locally",
|
||||
Action: func(context *cli.Context) error {
|
||||
var (
|
||||
exitErr error
|
||||
@ -255,13 +255,12 @@ var imagesCheckCommand = cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
var imageRemoveCommand = cli.Command{
|
||||
var removeCommand = cli.Command{
|
||||
Name: "remove",
|
||||
Aliases: []string{"rm"},
|
||||
Usage: "Remove one or more images by reference.",
|
||||
ArgsUsage: "[flags] <ref> [<ref>, ...]",
|
||||
Description: `Remove one or more images by reference.`,
|
||||
Flags: []cli.Flag{},
|
||||
Usage: "remove one or more images by reference",
|
||||
ArgsUsage: "<ref> [<ref>, ...]",
|
||||
Description: "remove one or more images by reference",
|
||||
Action: func(context *cli.Context) error {
|
||||
client, ctx, cancel, err := commands.NewClient(context)
|
||||
if err != nil {
|
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package images
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@ -11,11 +11,11 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
var imagesImportCommand = cli.Command{
|
||||
var importCommand = cli.Command{
|
||||
Name: "import",
|
||||
Usage: "import an image",
|
||||
ArgsUsage: "[flags] <ref> <in>",
|
||||
Description: `Import an image from a tar stream.`,
|
||||
Description: "import an image from a tar stream",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "ref-object",
|
@ -6,9 +6,10 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/containerd/containerd/cmd/ctr/commands/containers"
|
||||
"github.com/containerd/containerd/cmd/ctr/commands/images"
|
||||
"github.com/containerd/containerd/cmd/ctr/commands/plugins"
|
||||
versionCmd "github.com/containerd/containerd/cmd/ctr/commands/version"
|
||||
"github.com/containerd/containerd/cmd/ctr/commands/containers"
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
"github.com/containerd/containerd/server"
|
||||
"github.com/containerd/containerd/version"
|
||||
@ -75,7 +76,7 @@ containerd CLI
|
||||
eventsCommand,
|
||||
fetchCommand,
|
||||
fetchObjectCommand,
|
||||
imageCommand,
|
||||
images.Command,
|
||||
namespacesCommand,
|
||||
pprofCommand,
|
||||
pullCommand,
|
||||
|
Loading…
Reference in New Issue
Block a user