Resolve runtime dependency platform digests
This commit is contained in:
@@ -41,8 +41,8 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--api-metadata", type=Path, required=True)
|
||||
parser.add_argument("--web-metadata", type=Path, required=True)
|
||||
parser.add_argument("--postgres-image", required=True)
|
||||
parser.add_argument("--redis-image", required=True)
|
||||
parser.add_argument("--postgres-metadata", type=Path, required=True)
|
||||
parser.add_argument("--redis-metadata", type=Path, required=True)
|
||||
parser.add_argument("--platform", choices=sorted(PLATFORMS), required=True)
|
||||
parser.add_argument("--output", type=Path, required=True)
|
||||
parser.add_argument("--timeout-seconds", type=float, default=600.0)
|
||||
@@ -625,11 +625,17 @@ def main() -> int:
|
||||
try:
|
||||
api_image = platform_image(args.api_metadata, args.platform, "API")
|
||||
web_image = platform_image(args.web_metadata, args.platform, "Web")
|
||||
postgres_image = platform_image(
|
||||
args.postgres_metadata,
|
||||
args.platform,
|
||||
"PostgreSQL",
|
||||
)
|
||||
redis_image = platform_image(args.redis_metadata, args.platform, "Redis")
|
||||
evidence = run_smoke(
|
||||
api_image=api_image,
|
||||
web_image=web_image,
|
||||
postgres_image=args.postgres_image,
|
||||
redis_image=args.redis_image,
|
||||
postgres_image=postgres_image,
|
||||
redis_image=redis_image,
|
||||
platform=args.platform,
|
||||
timeout=args.timeout_seconds,
|
||||
)
|
||||
|
||||
@@ -21,6 +21,12 @@ def resolve_platforms(
|
||||
) -> dict[str, object]:
|
||||
if not repository or "@" in repository or any(value.isspace() for value in repository):
|
||||
raise ValueError("repository must be an unpinned OCI repository name")
|
||||
last_slash = repository.rfind("/")
|
||||
last_colon = repository.rfind(":")
|
||||
if last_colon > last_slash:
|
||||
repository = repository[:last_colon]
|
||||
if not repository:
|
||||
raise ValueError("repository must be an unpinned OCI repository name")
|
||||
if DIGEST.fullmatch(index_digest) is None:
|
||||
raise ValueError("index digest must be sha256:<hex>")
|
||||
if not isinstance(payload, dict) or not isinstance(payload.get("manifests"), list):
|
||||
|
||||
Reference in New Issue
Block a user