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:
Valentin Rothberg
2023-01-26 10:20:38 +01:00
parent 6132c4d548
commit c74bdae351
13 changed files with 83 additions and 71 deletions

View File

@ -283,7 +283,7 @@ func (r *RootlessNetNS) Cleanup(runtime *Runtime) error {
// only if the netns is empty we know that we do not need cleanup
return c.state.NetNS != ""
}
ctrs, err := runtime.GetContainers(activeNetns)
ctrs, err := runtime.GetContainers(false, activeNetns)
if err != nil {
return err
}