summaryrefslogtreecommitdiff
path: root/cmd/podman/pod_create.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-03-07 15:20:29 -0600
committerbaude <bbaude@redhat.com>2019-03-11 09:42:22 -0500
commit651520389d239f335248a27595d39a815ef95238 (patch)
tree819492990e69d0d5f5b9b276aa789e0d21e31297 /cmd/podman/pod_create.go
parent9b42577c322b74906d4dfa64926d9f187e2e2976 (diff)
downloadpodman-651520389d239f335248a27595d39a815ef95238.tar.gz
podman-651520389d239f335248a27595d39a815ef95238.tar.bz2
podman-651520389d239f335248a27595d39a815ef95238.zip
preparation for remote-client create container
to prepare for being able to remotely run a container, we need to perform a refactor to get code out of main because it is not reusable. the shared location is a good starting spot though eventually some will likely end up in pkg/spec/ at some point. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/pod_create.go')
-rw-r--r--cmd/podman/pod_create.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/podman/pod_create.go b/cmd/podman/pod_create.go
index d2b7da597..2f7a6b415 100644
--- a/cmd/podman/pod_create.go
+++ b/cmd/podman/pod_create.go
@@ -5,6 +5,7 @@ import (
"os"
"github.com/containers/libpod/cmd/podman/cliconfig"
+ "github.com/containers/libpod/cmd/podman/shared"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/adapter"
"github.com/pkg/errors"
@@ -14,8 +15,8 @@ import (
var (
// Kernel namespaces shared by default within a pod
- DefaultKernelNamespaces = "cgroup,ipc,net,uts"
- podCreateCommand cliconfig.PodCreateValues
+
+ podCreateCommand cliconfig.PodCreateValues
podCreateDescription = `After creating the pod, the pod ID is printed to stdout.
@@ -50,7 +51,7 @@ func init() {
flags.StringVarP(&podCreateCommand.Name, "name", "n", "", "Assign a name to the pod")
flags.StringVar(&podCreateCommand.PodIDFile, "pod-id-file", "", "Write the pod ID to the file")
flags.StringSliceVarP(&podCreateCommand.Publish, "publish", "p", []string{}, "Publish a container's port, or a range of ports, to the host (default [])")
- flags.StringVar(&podCreateCommand.Share, "share", DefaultKernelNamespaces, "A comma delimited list of kernel namespaces the pod will share")
+ flags.StringVar(&podCreateCommand.Share, "share", shared.DefaultKernelNamespaces, "A comma delimited list of kernel namespaces the pod will share")
}
@@ -87,7 +88,7 @@ func podCreateCmd(c *cliconfig.PodCreateValues) error {
defer podIdFile.Sync()
}
- labels, err := getAllLabels(c.LabelFile, c.Labels)
+ labels, err := shared.GetAllLabels(c.LabelFile, c.Labels)
if err != nil {
return errors.Wrapf(err, "unable to process labels")
}