diff options
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/define/info.go | 7 | ||||
-rw-r--r-- | libpod/networking_linux.go | 2 | ||||
-rw-r--r-- | libpod/pod.go | 5 | ||||
-rw-r--r-- | libpod/pod_api.go | 2 |
4 files changed, 14 insertions, 2 deletions
diff --git a/libpod/define/info.go b/libpod/define/info.go index 906aa523f..f136936f7 100644 --- a/libpod/define/info.go +++ b/libpod/define/info.go @@ -27,6 +27,7 @@ type HostInfo struct { MemTotal int64 `json:"memTotal"` OCIRuntime *OCIRuntimeInfo `json:"ociRuntime"` OS string `json:"os"` + RemoteSocket *RemoteSocket `json:"remoteSocket,omitempty"` Rootless bool `json:"rootless"` RuntimeInfo map[string]interface{} `json:"runtimeInfo,omitempty"` Slirp4NetNS SlirpInfo `json:"slirp4netns,omitempty"` @@ -36,6 +37,12 @@ type HostInfo struct { Linkmode string `json:"linkmode"` } +// RemoteSocket describes information about the API socket +type RemoteSocket struct { + Path string `json:"path,omitempty"` + Exists bool `json:"exists,omitempty"` +} + // SlirpInfo describes the slirp exectuable that // is being being used. type SlirpInfo struct { diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index 83344ebbe..0c9d28701 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -550,7 +550,7 @@ func getContainerNetNS(ctr *Container) (string, error) { if err = c.syncContainer(); err != nil { return "", err } - return c.state.NetNS.Path(), nil + return getContainerNetNS(c) } return "", nil } diff --git a/libpod/pod.go b/libpod/pod.go index 34ceef5ef..8afaa6052 100644 --- a/libpod/pod.go +++ b/libpod/pod.go @@ -171,6 +171,11 @@ func (p *Pod) SharesCgroup() bool { return p.config.UsePodCgroupNS } +// Hostname returns the hostname of the pod. +func (p *Pod) Hostname() string { + return p.config.Hostname +} + // CgroupPath returns the path to the pod's CGroup func (p *Pod) CgroupPath() (string, error) { p.lock.Lock() diff --git a/libpod/pod_api.go b/libpod/pod_api.go index 0be9f2573..e2c4b515d 100644 --- a/libpod/pod_api.go +++ b/libpod/pod_api.go @@ -490,7 +490,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) { Namespace: p.Namespace(), Created: p.CreatedTime(), State: podState, - Hostname: "", + Hostname: p.config.Hostname, Labels: p.Labels(), CreateCgroup: false, CgroupParent: p.CgroupParent(), |