aboutsummaryrefslogtreecommitdiff
path: root/cmd/kpod/create.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2017-11-01 16:44:08 -0500
committerbaude <bbaude@redhat.com>2017-11-03 20:37:19 -0500
commit46d762176eafb748b2094bd518ecf66d86388779 (patch)
treeca73c03853f2fd05e7fd23a8acf29c01a8d41170 /cmd/kpod/create.go
parent9f5fa7f2eb4c2a441dc224c45ba981d595ac3638 (diff)
downloadpodman-46d762176eafb748b2094bd518ecf66d86388779.tar.gz
podman-46d762176eafb748b2094bd518ecf66d86388779.tar.bz2
podman-46d762176eafb748b2094bd518ecf66d86388779.zip
create_cli_test.go: Unittests
Create unittests for the create_cli helper functions. As such, remove cli context usage from the functions to further divide between cli input and parsing. Also, simplifies unit testing. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/kpod/create.go')
-rw-r--r--cmd/kpod/create.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go
index 9d4d08b08..545714c68 100644
--- a/cmd/kpod/create.go
+++ b/cmd/kpod/create.go
@@ -252,13 +252,12 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
}
// LABEL VARIABLES
- labels, err := getAllLabels(c)
+ labels, err := getAllLabels(c.StringSlice("label-file"), c.StringSlice("labels"))
if err != nil {
return &createConfig{}, errors.Wrapf(err, "unable to process labels")
}
// ENVIRONMENT VARIABLES
- // TODO where should env variables be verified to be x=y format
- env, err := getAllEnvironmentVariables(c)
+ env, err := getAllEnvironmentVariables(c.StringSlice("env-file"), c.StringSlice("env"))
if err != nil {
return &createConfig{}, errors.Wrapf(err, "unable to process environment variables")
}