mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
DB: make loading container states optional
Loading container states speed things up when listing all containers but it comes with a price tag for many other call paths. Hence, make loading the state conditional to allow for keeping `podman ps` fast without other commands regressing in performance. [NO NEW TESTS NEEDED] Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -96,9 +96,10 @@ type State interface { //nolint:interfacebloat
|
||||
// The container being checked must be part of the set namespace.
|
||||
ContainerInUse(ctr *Container) ([]string, error)
|
||||
// Retrieves all containers presently in state.
|
||||
// If `loadState` is set, the containers' state will be loaded as well.
|
||||
// If a namespace is set, only containers within the namespace will be
|
||||
// returned.
|
||||
AllContainers() ([]*Container, error)
|
||||
AllContainers(loadState bool) ([]*Container, error)
|
||||
|
||||
// Get networks the container is currently connected to.
|
||||
GetNetworks(ctr *Container) (map[string]types.PerNetworkOptions, error)
|
||||
|
Reference in New Issue
Block a user