From 4614419e531d74a5f14d39e9b322ccb78f8d1e9d Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Wed, 22 Mar 2017 21:53:05 -0400 Subject: [PATCH] config: add app registry feature flag --- config.py | 3 +++ registry.py | 10 +++++++--- web.py | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 9da6fd30d..79cf034a6 100644 --- a/config.py +++ b/config.py @@ -231,6 +231,9 @@ class DefaultConfig(object): # Feature Flag: Whether to support signing FEATURE_SIGNING = False + # Feature Flag: Whether to enable support for App repositories. + FEATURE_APP_REGISTRY = True + # The namespace to use for library repositories. # Note: This must remain 'library' until Docker removes their hard-coded namespace for libraries. # See: https://github.com/docker/docker/blob/master/registry/session.go#L320 diff --git a/registry.py b/registry.py index df868242c..828bbe657 100644 --- a/registry.py +++ b/registry.py @@ -2,11 +2,12 @@ import logging import logging.config import os +import endpoints.decorated # Note: We need to import this module to make sure the decorators are registered. +import features + from app import app as application -# Note: We need to import this module to make sure the decorators are registered. -import endpoints.decorated - +from endpoints.appr import appr_bp from endpoints.v1 import v1_bp from endpoints.v2 import v2_bp @@ -15,3 +16,6 @@ if os.environ.get('DEBUGLOG') == 'true': application.register_blueprint(v1_bp, url_prefix='/v1') application.register_blueprint(v2_bp, url_prefix='/v2') + +if features.APP_REGISTRY: + application.register_blueprint(appr_bp, url_prefix='/cnr') diff --git a/web.py b/web.py index c07d1eea2..904dd9e98 100644 --- a/web.py +++ b/web.py @@ -2,7 +2,6 @@ import os import logging.config from app import app as application - from endpoints.api import api_bp from endpoints.bitbuckettrigger import bitbuckettrigger from endpoints.githubtrigger import githubtrigger