summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2020-04-24 09:44:51 -0400
committerMatthew Heon <mheon@redhat.com>2020-04-24 09:44:51 -0400
commitb1552d9124d3d2f927366a86c31a7902eb60ca64 (patch)
treee846f513577a5890a1bfbd7ffdf8e25941aa7293 /pkg/specgen/generate
parent46463e454e7fed9c25c762912a1dc7c3c7421cce (diff)
downloadpodman-b1552d9124d3d2f927366a86c31a7902eb60ca64.tar.gz
podman-b1552d9124d3d2f927366a86c31a7902eb60ca64.tar.bz2
podman-b1552d9124d3d2f927366a86c31a7902eb60ca64.zip
Do not join pod namespaces without an infra ctr
We do not want to join pod namespaces if no infra container is present. A pod may claim it shares namespaces without an infra container (I'll take an action item to fix that - it really should not be allowed), which was tripping up our default namespace code and forcing us to try and join the namespaces of the nonexistant infra container. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/namespaces.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/specgen/generate/namespaces.go b/pkg/specgen/generate/namespaces.go
index 2aaeb9513..2e0e088bf 100644
--- a/pkg/specgen/generate/namespaces.go
+++ b/pkg/specgen/generate/namespaces.go
@@ -26,7 +26,7 @@ func GetDefaultNamespaceMode(nsType string, cfg *config.Config, pod *libpod.Pod)
nsType = strings.ToLower(nsType)
// If the pod is not nil - check shared namespaces
- if pod != nil {
+ if pod != nil && pod.HasInfraContainer() {
podMode := false
switch {
case nsType == "pid" && pod.SharesPID():