summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-11-11 15:35:11 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-11-12 18:32:01 +0100
commit164c42b4857c63fa9750599a9242709ed18c57db (patch)
tree1797dec63bd1b39266f7cfb4dbfbff12fe732e6c /pkg/specgen
parent5f3ce2515d9bbae726e14ef4bc7dede442a6c582 (diff)
downloadpodman-164c42b4857c63fa9750599a9242709ed18c57db.tar.gz
podman-164c42b4857c63fa9750599a9242709ed18c57db.tar.bz2
podman-164c42b4857c63fa9750599a9242709ed18c57db.zip
Fix network mode in play kube
We need to use the config network mode when no network mode was set. To do so we have to keep the nsmode empty, MakeContainer() will use the correct network mode from the config when needed. Fixes #12248 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/pod_create.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go
index 501bce05d..bfd81739a 100644
--- a/pkg/specgen/generate/pod_create.go
+++ b/pkg/specgen/generate/pod_create.go
@@ -12,7 +12,6 @@ import (
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/domain/entities"
- "github.com/containers/podman/v3/pkg/rootless"
"github.com/containers/podman/v3/pkg/specgen"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@@ -216,15 +215,6 @@ func MapSpec(p *specgen.PodSpecGenerator) (*specgen.SpecGenerator, error) {
logrus.Debugf("No networking because the infra container is missing")
break
}
- if rootless.IsRootless() {
- logrus.Debugf("Pod will use slirp4netns")
- if p.InfraContainerSpec.NetNS.NSMode != "host" {
- p.InfraContainerSpec.NetworkOptions = p.NetworkOptions
- p.InfraContainerSpec.NetNS.NSMode = specgen.NamespaceMode("slirp4netns")
- }
- } else {
- logrus.Debugf("Pod using bridge network mode")
- }
case specgen.Bridge:
p.InfraContainerSpec.NetNS.NSMode = specgen.Bridge
logrus.Debugf("Pod using bridge network mode")
@@ -258,7 +248,6 @@ func MapSpec(p *specgen.PodSpecGenerator) (*specgen.SpecGenerator, error) {
return nil, errors.Errorf("pods presently do not support network mode %s", p.NetNS.NSMode)
}
- libpod.WithPodCgroups()
if len(p.InfraCommand) > 0 {
p.InfraContainerSpec.Entrypoint = p.InfraCommand
}