File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 17
17
import datetime
18
18
import os
19
19
import random
20
+ import re
20
21
import string
21
22
22
23
from ..utils .console import xpk_exit , xpk_print
26
27
DEFAULT_DOCKER_IMAGE = 'python:3.10'
27
28
DEFAULT_SCRIPT_DIR = os .getcwd ()
28
29
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
+ ]
30
35
31
36
32
37
def validate_docker_image (docker_image , args ) -> int :
@@ -235,7 +240,7 @@ def setup_docker_image(args) -> tuple[int, str]:
235
240
docker_image = DEFAULT_DOCKER_IMAGE
236
241
237
242
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
239
244
)
240
245
241
246
if is_cloud_image :
You can’t perform that action at this time.
0 commit comments