summaryrefslogtreecommitdiff
path: root/libpod/state.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-01-18 10:49:01 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-09 15:01:34 +0000
commit6214be07c2bf82f90361f058ab0c7178b634ecf9 (patch)
tree34a1e85e4f6bfca99e4207f102c5c0d208a00289 /libpod/state.go
parentbf981fc8738ec5910efd54117677f8eacb7ca37e (diff)
downloadpodman-6214be07c2bf82f90361f058ab0c7178b634ecf9.tar.gz
podman-6214be07c2bf82f90361f058ab0c7178b634ecf9.tar.bz2
podman-6214be07c2bf82f90361f058ab0c7178b634ecf9.zip
Tear out pod containers map. Instead rely on state
This ensures that there is only one canonical place where containers in a pod are stored, in the state itself. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
Diffstat (limited to 'libpod/state.go')
-rw-r--r--libpod/state.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/libpod/state.go b/libpod/state.go
index 01ae58bd1..3e5da9306 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -42,17 +42,17 @@ type State interface {
LookupPod(idOrName string) (*Pod, error)
// Checks if a pod with the given ID is present in the state
HasPod(id string) (bool, error)
- // Get all the containers in a pod. Accepts full ID of pod.
- PodContainers(id string) ([]*Container, error)
+ // Check if a pod has a container with the given ID
+ PodHasContainer(pod *Pod, ctrID string) (bool, error)
+ // Get the IDs of all containers in a pod
+ PodContainersByID(pod *Pod) ([]string, error)
+ // Get all the containers in a pod
+ PodContainers(pod *Pod) ([]*Container, error)
// Adds pod to state
- // Only empty pods can be added to the state
AddPod(pod *Pod) error
// Removes pod from state
- // Containers within a pod will not be removed from the state, and will
- // not be changed to remove them from the now-removed pod
+ // Only empty pods can be removed from the state
RemovePod(pod *Pod) error
- // UpdatePod updates a pod's state from the backing store
- UpdatePod(pod *Pod) error
// AddContainerToPod adds a container to an existing pod
// The container given will be added to the state and the pod
AddContainerToPod(pod *Pod, ctr *Container) error