Skip to content

Commit 6bf4461

Browse files
committed
Update cloud prefix list
1 parent b70f1b8 commit 6bf4461

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/xpk/core/docker_image.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import datetime
1818
import os
1919
import random
20+
import re
2021
import string
2122

2223
from ..utils.console import xpk_exit, xpk_print
@@ -26,7 +27,11 @@
2627
DEFAULT_DOCKER_IMAGE = 'python:3.10'
2728
DEFAULT_SCRIPT_DIR = os.getcwd()
2829
PLATFORM = 'linux/amd64'
29-
CLOUD_PREFIXES = ['gcr.io', 'docker.pkg.dev', 'us-docker.pkg.dev']
30+
CLOUD_PREFIXES = [
31+
r'^gcr\.io',
32+
r'^docker\.pkg\.dev',
33+
r'^([a-z0-9-]+)-docker\.pkg\.dev',
34+
]
3035

3136

3237
def validate_docker_image(docker_image, args) -> int:
@@ -235,7 +240,7 @@ def setup_docker_image(args) -> tuple[int, str]:
235240
docker_image = DEFAULT_DOCKER_IMAGE
236241

237242
is_cloud_image = any(
238-
docker_image.startswith(prefix) for prefix in CLOUD_PREFIXES
243+
re.match(prefix, docker_image) for prefix in CLOUD_PREFIXES
239244
)
240245

241246
if is_cloud_image:

0 commit comments

Comments
 (0)