mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
Use GetContainer instead of LookupContainer for full ID
All IDs in libpod are stored as a full container ID. We can get a container by full ID faster with GetContainer (which directly retrieves) than LookupContainer (which finds a match, then retrieves). No reason to use Lookup when we have full IDs present and available. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -547,16 +547,6 @@ func (r *Runtime) GetLatestContainer() (*Container, error) {
|
||||
return ctrs[lastCreatedIndex], nil
|
||||
}
|
||||
|
||||
// Export is the libpod portion of exporting a container to a tar file
|
||||
func (r *Runtime) Export(name string, path string) error {
|
||||
ctr, err := r.LookupContainer(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ctr.Export(path)
|
||||
|
||||
}
|
||||
|
||||
// RemoveContainersFromStorage attempt to remove containers from storage that do not exist in libpod database
|
||||
func (r *Runtime) RemoveContainersFromStorage(ctrs []string) {
|
||||
for _, i := range ctrs {
|
||||
|
Reference in New Issue
Block a user