Skip to content

Commit 496b1be

Browse files
committed
Move VALID_NAME_CHARS
Moving validation to be in config, as this is where we are doing our validation against the schema. Going to need this for error handling when someone specifies an invalid service name. Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
1 parent c0236c1 commit 496b1be

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compose/config.py

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from compose.cli.utils import find_candidates_in_parent_dirs
1212

1313

14+
VALID_NAME_CHARS = '[a-zA-Z0-9\._\-]'
15+
1416
DOCKER_CONFIG_KEYS = [
1517
'cap_add',
1618
'cap_drop',

compose/service.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from docker.utils import create_host_config, LogConfig
1313

1414
from . import __version__
15-
from .config import DOCKER_CONFIG_KEYS, merge_environment
15+
from .config import DOCKER_CONFIG_KEYS, merge_environment, VALID_NAME_CHARS
1616
from .const import (
1717
DEFAULT_TIMEOUT,
1818
LABEL_CONTAINER_NUMBER,
@@ -49,8 +49,6 @@
4949
'security_opt',
5050
]
5151

52-
VALID_NAME_CHARS = '[a-zA-Z0-9\._\-]'
53-
5452

5553
class BuildError(Exception):
5654
def __init__(self, service, reason):

0 commit comments

Comments
 (0)