Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dstack/_internal/core/models/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
)

CommandsList = List[str]
ValidPort = conint(gt=0, le=65536)
ValidPort = conint(gt=0, le=65535)
MAX_INT64 = 2**63 - 1
SERVICE_HTTPS_DEFAULT = True
STRIP_PREFIX_DEFAULT = True
Expand Down
9 changes: 9 additions & 0 deletions src/tests/_internal/pydantic_compat/test_field_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ def test_service_port_variants_are_normalized(self, raw: Any, expected: dict[str
assert class_name(config.port) == "PortMapping"
assert config.port.dict() == expected

@pytest.mark.parametrize("ports", [[65536], ["65536:80"], ["80:65536"]])
def test_task_ports_above_tcp_range_are_rejected(self, ports: list[Any]):
with pytest.raises(ConfigurationError, match="65535"):
parse_apply_configuration(_task(ports=ports))

def test_service_port_above_tcp_range_is_rejected(self):
with pytest.raises(ConfigurationError, match="65535"):
parse_apply_configuration(_service(port=65536))


class TestMountPointFieldParsing:
def test_string_arms_select_volume_and_instance_mount_models(self):
Expand Down
Loading