File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
cmd/ecr-credential-provider Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ import (
4343const ecrPublicRegion string = "us-east-1"
4444const ecrPublicHost string = "public.ecr.aws"
4545
46- var ecrPrivateHostPattern = regexp .MustCompile (`^(\d{12})\.dkr[\.\-]ecr(\-fips)?\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.(amazonaws\.com(?:\.cn)?|on\.(?:aws|amazonwebservices\.com\.cn)|sc2s\.sgov\.gov|c2s\.ic\.gov|cloud\.adc-e\.uk|csp\.hci\.ic\.gov)$` )
46+ var ecrPrivateHostPattern = regexp .MustCompile (`^(\d{12})\.dkr[\.\-]ecr(\-fips)?\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.(amazonaws\.(?: com(?:\.cn)?|eu) |on\.(?:aws|amazonwebservices\.com\.cn)|sc2s\.sgov\.gov|c2s\.ic\.gov|cloud\.adc-e\.uk|csp\.hci\.ic\.gov)$` )
4747
4848// ECR abstracts the calls we make to aws-sdk for testing purposes
4949type ECR interface {
Original file line number Diff line number Diff line change @@ -476,6 +476,12 @@ func Test_parseRegionFromECRPrivateHost(t *testing.T) {
476476 host : "123456789123.dkr.ecr.us-iso-east-1.c2s.ic.gov" ,
477477 region : "us-iso-east-1" ,
478478 },
479+ // EUSC
480+ {
481+ name : "success" ,
482+ host : "123456789123.dkr.ecr.eusc-de-east-1.amazonaws.eu" ,
483+ region : "eusc-de-east-1" ,
484+ },
479485 // Dual-Stack
480486 {
481487 name : "success" ,
@@ -535,6 +541,10 @@ func TestRegistryPatternMatch(t *testing.T) {
535541 {"123456789012.dkr.ecr-fips.lala-land-1.amazonaws.com" , true },
536542 // .cn
537543 {"123456789012.dkr.ecr.lala-land-1.amazonaws.com.cn" , true },
544+ // .eu
545+ {"123456789012.dkr.ecr.eusc-de-east-1.amazonaws.eu" , true },
546+ // .eu with fips
547+ {"123456789012.dkr.ecr-fips.eusc-de-east-1.amazonaws.eu" , true },
538548 // registry ID too long
539549 {"1234567890123.dkr.ecr.lala-land-1.amazonaws.com" , false },
540550 // registry ID too short
You can’t perform that action at this time.
0 commit comments