summaryrefslogtreecommitdiff
path: root/libpod/pod_api.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/pod_api.go')
-rw-r--r--libpod/pod_api.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/libpod/pod_api.go b/libpod/pod_api.go
index 45aa5cb8d..0be9f2573 100644
--- a/libpod/pod_api.go
+++ b/libpod/pod_api.go
@@ -466,6 +466,24 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
if err != nil {
return nil, err
}
+
+ namespaces := map[string]bool{
+ "pid": p.config.UsePodPID,
+ "ipc": p.config.UsePodIPC,
+ "net": p.config.UsePodNet,
+ "mount": p.config.UsePodMount,
+ "user": p.config.UsePodUser,
+ "uts": p.config.UsePodUTS,
+ "cgroup": p.config.UsePodCgroupNS,
+ }
+
+ sharesNS := []string{}
+ for nsStr, include := range namespaces {
+ if include {
+ sharesNS = append(sharesNS, nsStr)
+ }
+ }
+
inspectData := define.InspectPodData{
ID: p.ID(),
Name: p.Name(),
@@ -480,7 +498,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
CreateInfra: false,
InfraContainerID: p.state.InfraContainerID,
InfraConfig: nil,
- SharedNamespaces: nil,
+ SharedNamespaces: sharesNS,
NumContainers: uint(len(containers)),
Containers: ctrs,
}