Skip to content

Commit 2133df0

Browse files
Merge pull request #96 from barberd/master
Changed url matching for ECR login to regexp instead of simple found …
2 parents a286a91 + 7c582f7 commit 2133df0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dpr401/common/docker_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import subprocess
2323
import sys
2424
import tempfile
25+
import re
2526

2627
import boto3
2728
import json
@@ -136,7 +137,7 @@ def _ecr_login_if_needed(image):
136137
ecr_client = boto3.client('ecr')
137138

138139
# Only ECR images need login
139-
if not ('dkr.ecr' in image and 'amazonaws.com' in image):
140+
if not re.compile(r'\d+\.dkr\.ecr\.[a-z0-9\-]*?\.amazonaws\.com/').match(image):
140141
return
141142

142143
# do we have the image?

0 commit comments

Comments
 (0)