containerd/cmd/dist/apply.go
Michael Crosby 4f2b443a27 Rewrite imports for new github org
This rewrites the Go imports after switching to the new github org.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-04-03 14:05:44 -07:00

37 lines
730 B
Go

package main
import (
contextpkg "context"
"os"
"github.com/containerd/containerd/archive"
"github.com/containerd/containerd/archive/compression"
"github.com/containerd/containerd/log"
"github.com/urfave/cli"
)
var applyCommand = cli.Command{
Name: "apply",
Usage: "apply layer from stdin to dir",
ArgsUsage: "[flags] <digest>",
Flags: []cli.Flag{},
Action: func(context *cli.Context) error {
var (
ctx = contextpkg.Background()
dir = context.Args().First()
)
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
},
}