Merge pull request #242 from runcom/fix-skopeo-layers

Fix skopeo layers and deprecate it
This commit is contained in:
Antonio Murdaca 2016-11-02 17:36:36 +01:00 committed by GitHub
commit bd816574ed

View File

@ -1,7 +1,10 @@
package main package main
import ( import (
"errors"
"fmt"
"io/ioutil" "io/ioutil"
"os"
"strings" "strings"
"github.com/containers/image/directory" "github.com/containers/image/directory"
@ -11,14 +14,17 @@ import (
"github.com/urfave/cli" "github.com/urfave/cli"
) )
// TODO(runcom): document args and usage
var layersCmd = cli.Command{ var layersCmd = cli.Command{
Name: "layers", Name: "layers",
Usage: "Get layers of IMAGE-NAME", Usage: "Get layers of IMAGE-NAME",
ArgsUsage: "IMAGE-NAME", ArgsUsage: "IMAGE-NAME [LAYER...]",
Action: func(c *cli.Context) error { Action: func(c *cli.Context) error {
fmt.Fprintln(os.Stderr, `DEPRECATED: skopeo layers is deprecated in favor of skopeo copy`)
if c.NArg() == 0 {
return errors.New("Usage: layers imageReference [layer...]")
}
rawSource, err := parseImageSource(c, c.Args()[0], []string{ rawSource, err := parseImageSource(c, c.Args()[0], []string{
// TODO: skopeo layers only support these now // TODO: skopeo layers only supports these now
// eventually we'll remove this command altogether... // eventually we'll remove this command altogether...
manifest.DockerV2Schema1SignedMediaType, manifest.DockerV2Schema1SignedMediaType,
manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1MediaType,