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:
commit
9f7b08d0ff
3 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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': {
|
||||
|
|
Reference in a new issue