summaryrefslogtreecommitdiff
path: root/libpod/state.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-02-10 15:11:32 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-12 14:28:07 +0000
commitdc6a99df4c5ea7facaca20129b2b6c5b53ddb3c1 (patch)
tree0f1915a7e7e296652b0c4aaabc765b5786cfa9ab /libpod/state.go
parent3962d10bd482d1c57707465e8f76e76b4abc9a9f (diff)
downloadpodman-dc6a99df4c5ea7facaca20129b2b6c5b53ddb3c1.tar.gz
podman-dc6a99df4c5ea7facaca20129b2b6c5b53ddb3c1.tar.bz2
podman-dc6a99df4c5ea7facaca20129b2b6c5b53ddb3c1.zip
Containers in a pod can only join namespaces in that pod
This solves some dependency problems in the state, and makes sense from a design standpoint. Containers not in a pod can still depend on the namespaces of containers joined to a pod, which we might also want to change in the future. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #184 Approved by: baude
Diffstat (limited to 'libpod/state.go')
-rw-r--r--libpod/state.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/libpod/state.go b/libpod/state.go
index 36b5a757b..ed52e3d46 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -9,18 +9,20 @@ type State interface {
// Refresh clears container and pod states after a reboot
Refresh() error
- // Accepts full ID of container
+ // Return a container from the database from its full ID
Container(id string) (*Container, error)
- // Accepts full or partial IDs (as long as they are unique) and names
+ // Return a container from the database by full or partial ID or full
+ // name
LookupContainer(idOrName string) (*Container, error)
- // Checks if a container with the given ID is present in the state
+ // Check if a container with the given full ID exists in the database
HasContainer(id string) (bool, error)
// Adds container to state
// The container cannot be part of a pod
+ // The container must have globally unique name and ID - pod names and
+ // IDs also conflict with container names and IDs
AddContainer(ctr *Container) error
// Removes container from state
- // The container will only be removed from the state, not from the pod
- // which the container belongs to
+ // Containers that are part of pods must use RemoveContainerFromPod
RemoveContainer(ctr *Container) error
// UpdateContainer updates a container's state from the backing store
UpdateContainer(ctr *Container) error