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"
)
const (
imgTypeDocker = "docker"
imgTypeAppc = "appc"
)
func inspect(c *cli.Context) (*types.ImageInspect, error) {
var (
imgInspect *types.ImageInspect
@ -16,12 +21,12 @@ func inspect(c *cli.Context) (*types.ImageInspect, error) {
imgType = c.GlobalString("img-type")
)
switch imgType {
case "docker":
case imgTypeDocker:
imgInspect, err = docker.GetData(c, name)
if err != nil {
return nil, err
}
case "appc":
case imgTypeAppc:
return nil, fmt.Errorf("TODO")
default:
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{
Name: "img-type",
Value: "",
Value: imgTypeDocker,
Usage: "Either docker or appc",
},
}