Add error return for missing params in ctr images

For missing required parameters adds error return before attempting any
actions to `ctr images` commands.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
Phil Estes
2018-01-26 09:14:13 -05:00
parent b268261446
commit d4fb0709c9
3 changed files with 9 additions and 1 deletions

View File

@@ -43,6 +43,9 @@ Currently, only OCI format is supported.
local = context.Args().Get(1)
desc ocispec.Descriptor
)
if out == "" || local == "" {
return errors.New("please provide both an output filename and an image reference to export")
}
client, ctx, cancel, err := commands.NewClient(context)
if err != nil {
return err