示例#1
0
def get_in_cluster_registry_spec(
        build_backend: Optional[str]) -> RegistryContextSpec:
    host = get_in_cluster_registry_host(build_backend)
    return RegistryContextSpec(host=host,
                               secret=None,
                               secret_keys=None,
                               insecure=True)
示例#2
0
def get_registry_spec_from_config(
        config: 'RegistryAccess') -> RegistryContextSpec:
    return RegistryContextSpec(
        host=config.host,
        secret=config.k8s_secret.k8s_ref if config.k8s_secret else None,
        secret_items=config.k8s_secret.items if config.k8s_secret else None,
        insecure=config.insecure)
示例#3
0
 def registry_spec(self):
     spec = RegistryContextSpec(host='https://some_host:5000',
                                secret='docker-conf',
                                secret_items=None,
                                insecure=False)
     assert spec.host == 'https://some_host:5000'
     assert spec.secret == 'docker-conf'
     assert spec.secret_items is None
     assert spec.insecure is False
示例#4
0
def get_registry_spec_from_config(
        config: 'RegistryAccess') -> RegistryContextSpec:
    return RegistryContextSpec(host=config.host,
                               secret=config.k8s_secret.secret_ref,
                               secret_keys=config.k8s_secret.keys,
                               insecure=config.insecure)