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 1717import datetime
1818import os
1919import random
20+ import re
2021import string
2122
2223from ..utils .console import xpk_exit , xpk_print
2627DEFAULT_DOCKER_IMAGE = 'python:3.10'
2728DEFAULT_SCRIPT_DIR = os .getcwd ()
2829PLATFORM = '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
3237def 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 :
You can’t perform that action at this time.
0 commit comments