aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/pods
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-05-08 13:25:41 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-05-08 13:25:41 -0400
commit7989e422b404c2fe182dac5154fbfe218c561b93 (patch)
treef6c398b04ea5c5cd863ab8d2643607df4f4c96bb /cmd/podman/pods
parent13db0f2b61b17e6f959fff832b40270352cd54da (diff)
downloadpodman-7989e422b404c2fe182dac5154fbfe218c561b93.tar.gz
podman-7989e422b404c2fe182dac5154fbfe218c561b93.tar.bz2
podman-7989e422b404c2fe182dac5154fbfe218c561b93.zip
Fix `podman pod create --infra=false`
We were accidentally setting incorrect defaults for the network namespace for rootless `pod create` when infra containers were not being created. This should resolve that issue. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/pods')
-rw-r--r--cmd/podman/pods/create.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index f97fa836a..e24cdef98 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -16,6 +16,7 @@ import (
"github.com/containers/libpod/pkg/specgen"
"github.com/containers/libpod/pkg/util"
"github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
@@ -81,6 +82,7 @@ func create(cmd *cobra.Command, args []string) error {
}
if !createOptions.Infra {
+ logrus.Debugf("Not creating an infra container")
if cmd.Flag("infra-command").Changed {
return errors.New("cannot set infra-command without an infra container")
}
@@ -114,6 +116,7 @@ func create(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
+ createOptions.Net.Network = specgen.Namespace{}
if cmd.Flag("network").Changed {
netInput, err := cmd.Flags().GetString("network")
if err != nil {
@@ -132,6 +135,7 @@ func create(cmd *cobra.Command, args []string) error {
n.NSMode = specgen.Bridge
createOptions.Net.CNINetworks = strings.Split(netInput, ",")
}
+ createOptions.Net.Network = n
}
if len(createOptions.Net.PublishPorts) > 0 {
if !createOptions.Infra {