summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-20 10:39:15 +0100
committerGitHub <noreply@github.com>2020-02-20 10:39:15 +0100
commit846405256b38b11babf05de3a7666ceb81577a72 (patch)
tree4224e4853f474f78c48a49177faf39b2235fc7d6 /cmd
parent7e33dc4300f78fe9121c564bc22435514730a0ea (diff)
parent97323808ed57cf52311a80c55339f8927614b7f0 (diff)
downloadpodman-846405256b38b11babf05de3a7666ceb81577a72.tar.gz
podman-846405256b38b11babf05de3a7666ceb81577a72.tar.bz2
podman-846405256b38b11babf05de3a7666ceb81577a72.zip
Merge pull request #5241 from mheon/pod_network_opts_add
Add network opts to pods
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/pod_create.go17
1 files changed, 2 insertions, 15 deletions
diff --git a/cmd/podman/pod_create.go b/cmd/podman/pod_create.go
index 0f72780f9..810f62f02 100644
--- a/cmd/podman/pod_create.go
+++ b/cmd/podman/pod_create.go
@@ -45,19 +45,7 @@ func init() {
podCreateCommand.SetUsageTemplate(UsageTemplate())
flags := podCreateCommand.Flags()
flags.SetInterspersed(false)
- // When we are ready to add the network options to the create commmand, we need to uncomment
- // the following
-
- //flags.AddFlagSet(getNetFlags())
-
- // Once this is uncommented, then the publish option below needs to be removed because it
- // conflicts with the publish in getNetFlags. Upon removal, the c.Publish will not work
- // anymore and needs to be cleaned up. I suggest starting with removing the Publish attribute
- // from PodCreateValues structure. Running make should then expose all areas that need to be
- // addressed. To get the value of publish (and other flags in getNetFlags, use the syntax:
- // c.<type>("<flag_name") or c.Bool("publish")
- // Remember to do this safely by checking len, etc.
-
+ flags.AddFlagSet(getNetFlags())
flags.StringVar(&podCreateCommand.CgroupParent, "cgroup-parent", "", "Set parent cgroup for the pod")
flags.BoolVar(&podCreateCommand.Infra, "infra", true, "Create an infra container associated with the pod to share namespaces with")
flags.StringVar(&podCreateCommand.InfraImage, "infra-image", define.DefaultInfraImage, "The image of the infra container to associate with the pod")
@@ -67,7 +55,6 @@ func init() {
flags.StringVarP(&podCreateCommand.Name, "name", "n", "", "Assign a name to the pod")
flags.StringVarP(&podCreateCommand.Hostname, "hostname", "", "", "Set a hostname 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", shared.DefaultKernelNamespaces, "A comma delimited list of kernel namespaces the pod will share")
}
@@ -83,7 +70,7 @@ func podCreateCmd(c *cliconfig.PodCreateValues) error {
}
defer runtime.DeferredShutdown(false)
- if len(c.Publish) > 0 {
+ if len(c.StringSlice("publish")) > 0 {
if !c.Infra {
return errors.Errorf("you must have an infra container to publish port bindings to the host")
}