summaryrefslogtreecommitdiff
path: root/libpod/pod.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-08-11 11:19:08 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-11 18:13:06 +0000
commit3ef9279cec43ca7e24fb00eb838d85e30b7e37f7 (patch)
tree989f39dc6a0a4330e0bb52e8797cb04630c6187c /libpod/pod.go
parent029d5aad56e00059d0c765172c15b0035bedcd06 (diff)
downloadpodman-3ef9279cec43ca7e24fb00eb838d85e30b7e37f7.tar.gz
podman-3ef9279cec43ca7e24fb00eb838d85e30b7e37f7.tar.bz2
podman-3ef9279cec43ca7e24fb00eb838d85e30b7e37f7.zip
Ensure pod inspect is locked and validity-checked
Also, don't return the internal podState struct - instead return a public inspect struct. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #1258 Approved by: rhatdan
Diffstat (limited to 'libpod/pod.go')
-rw-r--r--libpod/pod.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index 24469fea8..5d762190b 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -41,7 +41,7 @@ type PodConfig struct {
// join containers to it.
// If true, all containers joined to the pod will use the pod cgroup as
// their cgroup parent, and cannot set a different cgroup parent
- UsePodCgroup bool
+ UsePodCgroup bool `json:"usePodCgroup"`
// Time pod was created
CreatedTime time.Time `json:"created"`
@@ -50,17 +50,22 @@ type PodConfig struct {
// podState represents a pod's state
type podState struct {
// CgroupPath is the path to the pod's CGroup
- CgroupPath string
+ CgroupPath string `json:"cgroupPath"`
}
// PodInspect represents the data we want to display for
// podman pod inspect
type PodInspect struct {
Config *PodConfig
- State *podState
+ State *PodInspectState
Containers []PodContainerInfo
}
+// PodInspectState contains inspect data on the pod's state
+type PodInspectState struct {
+ CgroupPath string `json:"cgroupPath"`
+}
+
// PodContainerInfo keeps information on a container in a pod
type PodContainerInfo struct {
ID string `json:"id"`