|
29 | 29 | from ._utils.async_utils import TaskContext, synchronize_api |
30 | 30 | from ._utils.deprecation import deprecation_warning |
31 | 31 | from ._utils.mount_utils import validate_network_file_systems, validate_volumes |
32 | | -from ._utils.name_utils import is_valid_object_name |
| 32 | +from ._utils.name_utils import check_object_name |
33 | 33 | from ._utils.task_command_router_client import TaskCommandRouterClient |
34 | 34 | from .client import _Client |
35 | 35 | from .container_process import _ContainerProcess |
@@ -79,16 +79,6 @@ def _validate_exec_args(args: Sequence[str]) -> None: |
79 | 79 | ) |
80 | 80 |
|
81 | 81 |
|
82 | | -def _warn_if_invalid_name(name: str) -> None: |
83 | | - if not is_valid_object_name(name): |
84 | | - deprecation_warning( |
85 | | - (2025, 9, 3), |
86 | | - f"Sandbox name '{name}' will be considered invalid in a future release." |
87 | | - "\n\nNames may contain only alphanumeric characters, dashes, periods, and underscores," |
88 | | - " must be shorter than 64 characters, and cannot conflict with App ID strings.", |
89 | | - ) |
90 | | - |
91 | | - |
92 | 82 | class DefaultSandboxNameOverride(str): |
93 | 83 | """A singleton class that represents the default sandbox name override. |
94 | 84 |
|
@@ -440,7 +430,7 @@ async def _create( |
440 | 430 |
|
441 | 431 | _validate_exec_args(args) |
442 | 432 | if name is not None: |
443 | | - _warn_if_invalid_name(name) |
| 433 | + check_object_name(name, "Sandbox") |
444 | 434 |
|
445 | 435 | if block_network and (encrypted_ports or h2_ports or unencrypted_ports): |
446 | 436 | raise InvalidError("Cannot specify open ports when `block_network` is enabled") |
@@ -1020,7 +1010,7 @@ async def _experimental_from_snapshot( |
1020 | 1010 | client = client or await _Client.from_env() |
1021 | 1011 |
|
1022 | 1012 | if name is not None and name != _DEFAULT_SANDBOX_NAME_OVERRIDE: |
1023 | | - _warn_if_invalid_name(name) |
| 1013 | + check_object_name(name, "Sandbox") |
1024 | 1014 |
|
1025 | 1015 | if name is _DEFAULT_SANDBOX_NAME_OVERRIDE: |
1026 | 1016 | restore_req = api_pb2.SandboxRestoreRequest( |
|
0 commit comments