summaryrefslogtreecommitdiff
path: root/libpod/state.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-19 22:09:40 +0100
committerGitHub <noreply@github.com>2020-03-19 22:09:40 +0100
commitaa6c8c2e55a7de14fb22f89af14d5c0636eecee0 (patch)
tree20bb10c738de05c0e323c9ac737d8a7bd5c184f2 /libpod/state.go
parentc1ff17acfa647c62fcb8ca6b8f3d15ff45100fb0 (diff)
parente89c6382ae26b6d611106360fdba4f3f304e5616 (diff)
downloadpodman-aa6c8c2e55a7de14fb22f89af14d5c0636eecee0.tar.gz
podman-aa6c8c2e55a7de14fb22f89af14d5c0636eecee0.tar.bz2
podman-aa6c8c2e55a7de14fb22f89af14d5c0636eecee0.zip
Merge pull request #5088 from mheon/begin_exec_rework
Begin exec rework
Diffstat (limited to 'libpod/state.go')
-rw-r--r--libpod/state.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go
index b246b5eac..9690e5819 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -72,6 +72,8 @@ type State interface {
// Removes container from state.
// Containers that are part of pods must use RemoveContainerFromPod.
// The container must be part of the set namespace.
+ // All dependencies must be removed first.
+ // All exec sessions referencing the container must be removed first.
RemoveContainer(ctr *Container) error
// UpdateContainer updates a container's state from the backing store.
// The container must be part of the set namespace.
@@ -95,6 +97,30 @@ type State interface {
// Return a container config from the database by full ID
GetContainerConfig(id string) (*ContainerConfig, error)
+ // Add creates a reference to an exec session in the database.
+ // The container the exec session is attached to will be recorded.
+ // The container state will not be modified.
+ // The actual exec session itself is part of the container's state.
+ // We assume higher-level callers will add the session by saving the
+ // container's state before calling this. This only ensures that the ID
+ // of the exec session is associated with the ID of the container.
+ // Implementations may, but are not required to, verify that the state
+ // of the given container has an exec session with the ID given.
+ AddExecSession(ctr *Container, session *ExecSession) error
+ // Get retrieves the container a given exec session is attached to.
+ GetExecSession(id string) (string, error)
+ // Remove a reference to an exec session from the database.
+ // This will not modify container state to remove the exec session there
+ // and instead only removes the session ID -> container ID reference
+ // added by AddExecSession.
+ RemoveExecSession(session *ExecSession) error
+ // Get the IDs of all exec sessions attached to a given container.
+ GetContainerExecSessions(ctr *Container) ([]string, error)
+ // Remove all exec sessions for a single container.
+ // Usually used as part of removing the container.
+ // As with RemoveExecSession, container state will not be modified.
+ RemoveContainerExecSessions(ctr *Container) error
+
// PLEASE READ FULL DESCRIPTION BEFORE USING.
// Rewrite a container's configuration.
// This function breaks libpod's normal prohibition on a read-only