11from functools import cached_property
22from 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
125from pydantic_settings import SettingsConfigDict
136
147from .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" : [
0 commit comments