diff --git a/app.py b/app.py index 0fcda573c..52f18b6af 100644 --- a/app.py +++ b/app.py @@ -74,11 +74,14 @@ else: config_provider.update_app_config(app.config) # Update any configuration found in the override environment variable. -OVERRIDE_CONFIG_KEY = 'QUAY_OVERRIDE_CONFIG' - environ_config = json.loads(os.environ.get(OVERRIDE_CONFIG_KEY, '{}')) app.config.update(environ_config) +# Allow user to define a custom storage preference for the local instance. +_distributed_storage_preference = os.environ.get('QUAY_DISTRIBUTED_STORAGE_PREFERENCE', '').split() +if _distributed_storage_preference: + app.config['DISTRIBUTED_STORAGE_PREFERENCE'] = _distributed_storage_preference + class RequestWithId(Request): request_gen = staticmethod(urn_generator(['request'])) diff --git a/data/model/image.py b/data/model/image.py index 078875417..cdd81cf54 100644 --- a/data/model/image.py +++ b/data/model/image.py @@ -46,7 +46,7 @@ def get_repo_image(namespace_name, repository_name, docker_image_id): def get_repo_image_extended(namespace_name, repository_name, docker_image_id): def limit_to_image_id(query): - return query.where(Image.docker_image_id == docker_image_id).limit(1) + return query.where(Image.docker_image_id == docker_image_id) images = get_repository_images_base(namespace_name, repository_name, limit_to_image_id) if not images: