diff options
author | baude <bbaude@redhat.com> | 2018-01-10 14:46:21 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2018-01-11 18:42:54 -0600 |
commit | af3df2842c22667edf903eb6b5e2e606538c850e (patch) | |
tree | a3ac2f9c584afab6533484b169c3143d8ccde49d /cmd/podman/run.go | |
parent | 9adcb85929ac9536e967907c6a6057046a98ab16 (diff) | |
download | podman-af3df2842c22667edf903eb6b5e2e606538c850e.tar.gz podman-af3df2842c22667edf903eb6b5e2e606538c850e.tar.bz2 podman-af3df2842c22667edf903eb6b5e2e606538c850e.zip |
Test user input to spec
Create a mocked CLI instance so we can test that user-input
functions to run (create) end up in the spec correctly. It will
also help protect against regression include type changes.
We can decide if we want to test items one at a time or several
at a time.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r-- | cmd/podman/run.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go index d9bc00b78..eecfe87b3 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -41,8 +41,12 @@ func runCmd(c *cli.Context) error { return errors.Wrapf(err, "error creating libpod runtime") } defer runtime.Shutdown(false) + if len(c.Args()) < 1 { + return errors.Errorf("image name or ID is required") + } - createConfig, err := parseCreateOpts(c, runtime) + imageName, _, data, err := imageData(c, runtime, c.Args()[0]) + createConfig, err := parseCreateOpts(c, runtime, imageName, data) if err != nil { return err } |