Skip to content

Commit 92a40de

Browse files
continue fixing
1 parent 0302b4b commit 92a40de

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/models-library/src/models_library/docker.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@ def from_key(cls, key: str) -> "DockerLabelKey":
3737
str, StringConstraints(pattern=DOCKER_GENERIC_TAG_KEY_RE)
3838
]
3939

40-
41-
class DockerPlacementConstraint(ConstrainedStr):
42-
strip_whitespace = True
43-
regex = re.compile(
44-
r"^(?!-)(?![.])(?!.*--)(?!.*[.][.])[a-zA-Z0-9.-]*(?<!-)(?<![.])(!=|==)[a-zA-Z0-9_. -]*$"
45-
)
46-
40+
DockerPlacementConstraint: TypeAlias = Annotated[str, StringConstraints(strip_whitespace = True, pattern = re.compile(r"^(?!-)(?![.])(?!.*--)(?!.*[.][.])[a-zA-Z0-9.-]*(?<!-)(?<![.])(!=|==)[a-zA-Z0-9_. -]*$"))]
4741

4842
_SIMCORE_RUNTIME_DOCKER_LABEL_PREFIX: Final[str] = "io.simcore.runtime."
4943
_BACKWARDS_COMPATIBILITY_SIMCORE_RUNTIME_DOCKER_LABELS_MAP: Final[dict[str, str]] = {

services/director-v2/tests/unit/test_core_settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from models_library.basic_types import LogLevel
99
from pydantic import ValidationError
1010
from pytest_simcore.helpers.typing_env import EnvVarsDict
11+
from settings_library.base import DefaultFromEnvFactoryError
1112
from settings_library.r_clone import S3Provider
1213
from simcore_service_director_v2.core.dynamic_services_settings.egress_proxy import (
1314
EnvoyLogLevel,
@@ -185,7 +186,7 @@ def test_services_custom_constraint_failures(
185186
monkeypatch: pytest.MonkeyPatch,
186187
) -> None:
187188
monkeypatch.setenv("DIRECTOR_V2_SERVICES_CUSTOM_CONSTRAINTS", custom_constraints)
188-
with pytest.raises(Exception):
189+
with pytest.raises(DefaultFromEnvFactoryError):
189190
AppSettings.create_from_envs()
190191

191192

0 commit comments

Comments
 (0)