Merge pull request #2993 from coreos-inc/joseph.schorr/QUAY-797/pagination-size

Allow size of pages in V2 api to be configurable
This commit is contained in:
josephschorr 2018-02-02 15:21:15 -05:00 committed by GitHub
commit 9f7b08d0ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -503,3 +503,6 @@ class DefaultConfig(ImmutableConfig):
# Feature Flag: If enabled, users can create and use app specific tokens to login via the CLI.
FEATURE_APP_SPECIFIC_TOKENS = True
# The size of pages returned by the Docker V2 API.
V2_PAGINATION_SIZE = 50

View file

@ -41,7 +41,7 @@ def handle_registry_v2_exception(error):
return response
_MAX_RESULTS_PER_PAGE = 50
_MAX_RESULTS_PER_PAGE = app.config.get('V2_PAGINATION_SIZE', 50)
def paginate(limit_kwarg_name='limit', offset_kwarg_name='offset',

View file

@ -383,6 +383,10 @@ CONFIG_SCHEMA = {
'description': 'The types of avatars to display, either generated inline (local) or Gravatar (gravatar)',
'enum': ['local', 'gravatar'],
},
'V2_PAGINATION_SIZE': {
'type': 'number',
'description': 'The number of results returned per page in V2 registry APIs',
},
# Time machine and tag expiration settings.
'FEATURE_CHANGE_TAG_EXPIRATION': {