mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
sqlite: fix volume lookups with partial names
Requires the trailing `%` to work correctly, see https://www.sqlitetutorial.net/sqlite-like/ Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -2033,7 +2033,7 @@ func (s *SQLiteState) LookupVolume(name string) (*Volume, error) {
|
|||||||
return nil, define.ErrDBClosed
|
return nil, define.ErrDBClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
rows, err := s.conn.Query("SELECT JSON FROM VolumeConfig WHERE Name LIKE ?;", name)
|
rows, err := s.conn.Query("SELECT JSON FROM VolumeConfig WHERE Name LIKE ?;", name+"%")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("querying database for volume %s: %w", name, err)
|
return nil, fmt.Errorf("querying database for volume %s: %w", name, err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user