mirror of
https://github.com/containers/skopeo.git
synced 2025-08-09 02:17:39 +00:00
default to inspect docker images
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
1d452edce6
commit
01b47e3681
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user