diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-03-06 10:57:54 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 10:57:54 -0800 |
commit | fb14db49fed07b934d5e71e642d8e1d31194568b (patch) | |
tree | c505cabb84a91328138c6c3397124b2c14eabf91 /libpod | |
parent | ef714756b783b8d28ac015ec8627bdf7e9706e6d (diff) | |
parent | b4e184a2ac4925d5c86270bf9d19c4eb836c07f8 (diff) | |
download | podman-fb14db49fed07b934d5e71e642d8e1d31194568b.tar.gz podman-fb14db49fed07b934d5e71e642d8e1d31194568b.tar.bz2 podman-fb14db49fed07b934d5e71e642d8e1d31194568b.zip |
Merge pull request #2545 from haircommander/weird_pod_bug
Fix pod create failure
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_pod_linux.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index c378d18e4..9063390bd 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -95,9 +95,12 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, if pod.config.UsePodCgroup { logrus.Debugf("Got pod cgroup as %s", pod.state.CgroupPath) } - if pod.HasInfraContainer() != pod.SharesNamespaces() { + if !pod.HasInfraContainer() && pod.SharesNamespaces() { return nil, errors.Errorf("Pods must have an infra container to share namespaces") } + if pod.HasInfraContainer() && !pod.SharesNamespaces() { + logrus.Warnf("Pod has an infra container, but shares no namespaces") + } if err := r.state.AddPod(pod); err != nil { return nil, errors.Wrapf(err, "error adding pod to state") |