mirror of
https://github.com/containers/skopeo.git
synced 2025-09-03 23:55:21 +00:00
cmd/skopeo/layers: fix index out of range
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -15,10 +16,13 @@ import (
|
|||||||
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 {
|
||||||
|
if c.NArg() == 0 {
|
||||||
|
return errors.New("please specify an image")
|
||||||
|
}
|
||||||
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,
|
||||||
|
Reference in New Issue
Block a user