コード例 #1
0
def get_external_registries():
    registries = []
    for key in config.params_startswith(PRIVATE_REGISTRIES_PREFIX):
        registry_spec = config.get_string(key, is_secret=True)
        registry_spec = config.parse_uri_spec(registry_spec)
        if registry_spec:
            registries.append(registry_spec)

    return registries
コード例 #2
0
    def get_env_vars(self):
        env_vars = get_service_env_vars(namespace=self.namespace)
        for k, v in config.get_requested_params(to_str=True).items():
            env_vars.append(get_env_var(name=k, value=v))

        # Add private registries secrets keys
        for key in config.params_startswith(settings.PRIVATE_REGISTRIES_PREFIX):
            env_vars.append(get_from_secret(key, key))

        return env_vars
コード例 #3
0
ファイル: registry.py プロジェクト: xuduofeng/polyaxon
def get_external_registries():
    registries = []
    for key in config.params_startswith(PRIVATE_REGISTRIES_PREFIX):

        try:
            registry_dict = config.get_dict(key, is_secret=True)
            registry_spec = UriSpec(**registry_dict)
        except RheaError:
            registry_spec = config.get_string(key, is_secret=True)
            try:
                # We might get this value from a chart with `toJson` applied.
                registry_spec = json.loads(registry_spec)
            except json.decoder.JSONDecodeError:
                pass

            registry_spec = config.parse_uri_spec(registry_spec)

        if registry_spec:
            registries.append(registry_spec)

    return registries