Enable storage preference
This commit is contained in:
parent
4f6d81b1ec
commit
a7fef8377c
2 changed files with 6 additions and 3 deletions
7
app.py
7
app.py
|
@ -74,11 +74,14 @@ else:
|
||||||
config_provider.update_app_config(app.config)
|
config_provider.update_app_config(app.config)
|
||||||
|
|
||||||
# Update any configuration found in the override environment variable.
|
# 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, '{}'))
|
environ_config = json.loads(os.environ.get(OVERRIDE_CONFIG_KEY, '{}'))
|
||||||
app.config.update(environ_config)
|
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):
|
class RequestWithId(Request):
|
||||||
request_gen = staticmethod(urn_generator(['request']))
|
request_gen = staticmethod(urn_generator(['request']))
|
||||||
|
|
|
@ -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 get_repo_image_extended(namespace_name, repository_name, docker_image_id):
|
||||||
def limit_to_image_id(query):
|
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)
|
images = get_repository_images_base(namespace_name, repository_name, limit_to_image_id)
|
||||||
if not images:
|
if not images:
|
||||||
|
|
Reference in a new issue