ctr: remove apply command
* in its current state, apply command should not be in ctr Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
This commit is contained in:
parent
e4da49c44c
commit
7a1d709cc9
@ -1,38 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"github.com/containerd/containerd/archive"
|
|
||||||
"github.com/containerd/containerd/archive/compression"
|
|
||||||
"github.com/containerd/containerd/cmd/ctr/commands"
|
|
||||||
"github.com/containerd/containerd/log"
|
|
||||||
"github.com/urfave/cli"
|
|
||||||
)
|
|
||||||
|
|
||||||
var applyCommand = cli.Command{
|
|
||||||
Name: "apply",
|
|
||||||
Usage: "apply layer from stdin to dir",
|
|
||||||
ArgsUsage: "[flags] <path>",
|
|
||||||
Flags: []cli.Flag{},
|
|
||||||
Action: func(context *cli.Context) error {
|
|
||||||
var (
|
|
||||||
dir = context.Args().First()
|
|
||||||
)
|
|
||||||
ctx, cancel := commands.AppContext(context)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
log.G(ctx).Info("applying layer from stdin")
|
|
||||||
|
|
||||||
rd, err := compression.DecompressStream(os.Stdin)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, err := archive.Apply(ctx, dir, rd); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
}
|
|
@ -74,7 +74,6 @@ containerd CLI
|
|||||||
app.Commands = append([]cli.Command{
|
app.Commands = append([]cli.Command{
|
||||||
plugins.Command,
|
plugins.Command,
|
||||||
versionCmd.Command,
|
versionCmd.Command,
|
||||||
applyCommand,
|
|
||||||
containers.Command,
|
containers.Command,
|
||||||
content.Command,
|
content.Command,
|
||||||
events.Command,
|
events.Command,
|
||||||
|
Loading…
Reference in New Issue
Block a user