fix(release): align UAT image identity validation

This commit is contained in:
2026-09-27 14:44:35 +08:00
parent 27a612059e
commit b6b8354f4c
@@ -197,7 +197,6 @@ def preflight(env: dict[str, str], *, admin_a: str, admin_b: str, static_only: b
placeholders = sorted(key for key, value in env.items() if "CHANGE_ME" in value or "example.com" in value)
check(checks, "no_placeholders", not placeholders, "no placeholders found" if not placeholders else "placeholder keys: " + ", ".join(placeholders))
image_pattern = re.compile(r"^.+@sha256:[0-9a-fA-F]{64}$")
image_keys = (
"POSTGRES_IMAGE",
"POSTGRES_CLIENT_IMAGE",
@@ -210,7 +209,7 @@ def preflight(env: dict[str, str], *, admin_a: str, admin_b: str, static_only: b
"KMS_GATEWAY_IMAGE",
"EVIDENCE_WITNESS_GATEWAY_IMAGE",
)
invalid_images = [key for key in image_keys if not image_pattern.fullmatch(env.get(key, ""))]
invalid_images = [key for key in image_keys if not IMAGE_REFERENCE_RE.fullmatch(env.get(key, ""))]
check(checks, "immutable_images", not invalid_images, "all UAT images use immutable SHA-256 digests" if not invalid_images else "mutable or invalid image keys: " + ", ".join(invalid_images))
project = env.get("COMPOSE_PROJECT_NAME", "").lower()