diff options
author | haircommander <pehunt@redhat.com> | 2018-08-20 17:56:35 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-23 18:16:28 +0000 |
commit | 0e6266858a913ac36de0726ede10d5d03af533e3 (patch) | |
tree | 152c7b8b029d5eb80c6caf466c9d0ab1b0ef3913 /libpod/pod.go | |
parent | 2a7449362f2884d9ae6a783c0ce38979d882e2cf (diff) | |
download | podman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.gz podman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.bz2 podman-0e6266858a913ac36de0726ede10d5d03af533e3.zip |
Fixing network ns segfault
As well as small style corrections, update pod_top_test to use CreatePod, and move handling of adding a container to the pod's namespace from container_internal_linux to libpod/option.
Signed-off-by: haircommander <pehunt@redhat.com>
Closes: #1187
Approved by: mheon
Diffstat (limited to 'libpod/pod.go')
-rw-r--r-- | libpod/pod.go | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/libpod/pod.go b/libpod/pod.go index f8c656920..9c7a3e3a3 100644 --- a/libpod/pod.go +++ b/libpod/pod.go @@ -39,7 +39,6 @@ type PodConfig struct { Labels map[string]string `json:"labels"` // CgroupParent contains the pod's CGroup parent CgroupParent string `json:"cgroupParent"` - // UsePodCgroup indicates whether the pod will create its own CGroup and // join containers to it. // If true, all containers joined to the pod will use the pod cgroup as @@ -48,12 +47,12 @@ type PodConfig struct { // The following UsePod{kernelNamespace} indicate whether the containers // in the pod will inherit the namespace from the first container in the pod. - UsePodPID bool `json:"sharesPid,omitempty"` - UsePodIPC bool `json:"sharesIpc,omitempty"` - UsePodNet bool `json:"sharesNet,omitempty"` - UsePodMNT bool `json:"sharesMnt,omitempty"` - UsePodUser bool `json:"sharesUser,omitempty"` - UsePodUTS bool `json:"sharesUts,omitempty"` + UsePodPID bool `json:"sharesPid,omitempty"` + UsePodIPC bool `json:"sharesIpc,omitempty"` + UsePodNet bool `json:"sharesNet,omitempty"` + UsePodMount bool `json:"sharesMnt,omitempty"` + UsePodUser bool `json:"sharesUser,omitempty"` + UsePodUTS bool `json:"sharesUts,omitempty"` InfraContainer *InfraContainerConfig `json:"infraConfig"` @@ -149,10 +148,10 @@ func (p *Pod) SharesNet() bool { return p.config.UsePodNet } -// SharesMNT returns whether containers in pod +// SharesMount returns whether containers in pod // default to use PID namespace of first container in pod -func (p *Pod) SharesMNT() bool { - return p.config.UsePodMNT +func (p *Pod) SharesMount() bool { + return p.config.UsePodMount } // SharesUser returns whether containers in pod @@ -227,7 +226,7 @@ func (p *Pod) HasInfraContainer() bool { // SharesNamespaces checks if the pod has any kernel namespaces set as shared. An infra container will not be // created if no kernel namespaces are shared. func (p *Pod) SharesNamespaces() bool { - return p.SharesPID() || p.SharesIPC() || p.SharesNet() || p.SharesMNT() || p.SharesUser() || p.SharesUTS() + return p.SharesPID() || p.SharesIPC() || p.SharesNet() || p.SharesMount() || p.SharesUser() || p.SharesUTS() } // InfraContainerID returns the infra container ID for a pod. |