Prevent extra queries to load image storage data.
This commit is contained in:
parent
d4c41f2b11
commit
9ad7fc7a54
1 changed files with 3 additions and 0 deletions
|
@ -1089,6 +1089,9 @@ def _get_repository_images_base(namespace_name, repository_name, query_modifier)
|
||||||
# Make sure we're always retrieving the same image object.
|
# Make sure we're always retrieving the same image object.
|
||||||
image = location.storage.image
|
image = location.storage.image
|
||||||
|
|
||||||
|
# Set the storage to the one we got from the location, to prevent another query
|
||||||
|
image.storage = location.storage
|
||||||
|
|
||||||
if not image.id in images:
|
if not image.id in images:
|
||||||
images[image.id] = image
|
images[image.id] = image
|
||||||
image.storage.locations = set()
|
image.storage.locations = set()
|
||||||
|
|
Reference in a new issue