Skip to content

Commit fdd0eba

Browse files
committed
remove confusion
1 parent 6aa1350 commit fdd0eba

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

packages/settings-library/src/settings_library/docker_registry.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
from functools import cached_property
22
from typing import Any, Self
33

4-
from pydantic import (
5-
AnyHttpUrl,
6-
Field,
7-
SecretStr,
8-
TypeAdapter,
9-
field_validator,
10-
model_validator,
11-
)
4+
from pydantic import Field, SecretStr, field_validator, model_validator
125
from pydantic_settings import SettingsConfigDict
136

147
from .base import BaseCustomSettings
@@ -20,13 +13,12 @@ class RegistrySettings(BaseCustomSettings):
2013
default=None,
2114
# This is useful in case of a local registry, where the registry url (path) is relative to the host docker engine"
2215
description="development mode only, in case a local registry is used - "
23-
"this is the hostname to the docker registry as seen from inside the container",
16+
"this is the hostname to the docker registry as seen from the host running the containers (e.g. 127.0.0.1:5000)",
2417
)
2518
# NOTE: name is missleading, http or https protocol are not included
2619
REGISTRY_URL: str = Field(
2720
...,
28-
description="hostname of docker registry (without protocol but with port if available) - "
29-
"typically used by the host machine docker engine",
21+
description="hostname of docker registry (without protocol but with port if available)",
3022
min_length=1,
3123
)
3224

@@ -62,14 +54,6 @@ def resolved_registry_url(self) -> str:
6254
def api_url(self) -> str:
6355
return f"{self.REGISTRY_URL}/v2"
6456

65-
@cached_property
66-
def registry_url_for_docker_engine(self) -> AnyHttpUrl:
67-
"""returns the full URL to the Docker Registry for use by docker engine"""
68-
protocol = "https" if self.REGISTRY_SSL else "http"
69-
return TypeAdapter(AnyHttpUrl).validate_python(
70-
f"{protocol}://{self.REGISTRY_URL}"
71-
)
72-
7357
model_config = SettingsConfigDict(
7458
json_schema_extra={
7559
"examples": [

services/director/src/simcore_service_director/registry_proxy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ async def _basic_auth_registry_request(
6868
else None
6969
)
7070

71-
request_url = URL(
72-
f"{app_settings.DIRECTOR_REGISTRY.registry_url_for_docker_engine}"
73-
).with_path(path, encoded=True)
71+
request_url = URL(app_settings.DIRECTOR_REGISTRY.resolved_registry_url).with_path(
72+
path, encoded=True
73+
)
7474

7575
session = get_client_session(app)
7676
response = await session.request(

0 commit comments

Comments
 (0)