default to inspect docker images

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-02-07 18:13:30 +01:00
parent 1d452edce6
commit 01b47e3681
2 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,11 @@ import (
"github.com/runcom/skopeo/types" "github.com/runcom/skopeo/types"
) )
const (
imgTypeDocker = "docker"
imgTypeAppc = "appc"
)
func inspect(c *cli.Context) (*types.ImageInspect, error) { func inspect(c *cli.Context) (*types.ImageInspect, error) {
var ( var (
imgInspect *types.ImageInspect imgInspect *types.ImageInspect
@ -16,12 +21,12 @@ func inspect(c *cli.Context) (*types.ImageInspect, error) {
imgType = c.GlobalString("img-type") imgType = c.GlobalString("img-type")
) )
switch imgType { switch imgType {
case "docker": case imgTypeDocker:
imgInspect, err = docker.GetData(c, name) imgInspect, err = docker.GetData(c, name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
case "appc": case imgTypeAppc:
return nil, fmt.Errorf("TODO") return nil, fmt.Errorf("TODO")
default: default:
return nil, fmt.Errorf("%s image type is invalid, please use either 'docker' or 'appc'", imgType) return nil, fmt.Errorf("%s image type is invalid, please use either 'docker' or 'appc'", imgType)

View File

@ -54,7 +54,7 @@ func main() {
}, },
cli.StringFlag{ cli.StringFlag{
Name: "img-type", Name: "img-type",
Value: "", Value: imgTypeDocker,
Usage: "Either docker or appc", Usage: "Either docker or appc",
}, },
} }