Allow namespaces to be whitelisted for OCI, but not V22

This commit is contained in:
Joseph Schorr 2019-01-21 14:40:26 -05:00
parent 92808e8d3f
commit 7c241a93f6
4 changed files with 13 additions and 7 deletions

View file

@ -12,14 +12,15 @@ class RegistryModelProxy(object):
def __init__(self):
self._model = oci_model if os.getenv('OCI_DATA_MODEL') == 'true' else pre_oci_model
def setup_split(self, v22_whitelist):
def setup_split(self, oci_whitelist, v22_whitelist):
if os.getenv('OCI_DATA_MODEL') == 'true':
return
logger.info('===============================')
logger.info('Enabling split registry model with namespace whitelist `%s`', v22_whitelist)
logger.info('Enabling split registry model with OCI whitelist `%s` and V22 whitelist `%s`',
oci_whitelist, v22_whitelist)
logger.info('===============================')
self._model = SplitModel(v22_whitelist)
self._model = SplitModel(oci_whitelist, v22_whitelist)
def set_for_testing(self, use_oci_model):
self._model = oci_model if use_oci_model else pre_oci_model