update comments

This commit is contained in:
hari-dhanushkodi
2026-03-09 12:23:55 -04:00
parent ddd8666ff7
commit d45a6deba2
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -943,6 +943,11 @@ def deploy(
def _normalize_image_name(value: str | None) -> str:
"""Sanitize a deployment/directory name into a valid Docker repository name.
Docker repository names must be lowercase and may only contain
[a-z0-9._-]. Invalid characters are replaced with hyphens.
"""
if not value:
return "app"
slug = re.sub(r"[^a-z0-9._-]+", "-", value.lower()).strip("-.")
@@ -950,6 +955,10 @@ def _normalize_image_name(value: str | None) -> str:
def _normalize_image_tag(value: str) -> str:
"""Validate and return a Docker image tag.
Tags may only contain [A-Za-z0-9_.-]. Defaults to "latest" when empty.
"""
if not value:
value = "latest"
if not re.fullmatch(r"[A-Za-z0-9_.-]+", value):