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 @@ -42,7 +42,7 @@ import (
4242const ecrPublicRegion string = "us-east-1"
4343const ecrPublicHost string = "public.ecr.aws"
4444
45- 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)$` )
45+ 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)$` )
4646
4747// ECR abstracts the calls we make to aws-sdk for testing purposes
4848type ECR interface {
Original file line number Diff line number Diff line change @@ -352,6 +352,12 @@ func Test_parseRegionFromECRPrivateHost(t *testing.T) {
352352 host : "123456789123.dkr.ecr.us-iso-east-1.c2s.ic.gov" ,
353353 region : "us-iso-east-1" ,
354354 },
355+ // EUSC
356+ {
357+ name : "success" ,
358+ host : "123456789123.dkr.ecr.eusc-de-east-1.amazonaws.eu" ,
359+ region : "eusc-de-east-1" ,
360+ },
355361 // Dual-Stack
356362 {
357363 name : "success" ,
@@ -411,6 +417,10 @@ func TestRegistryPatternMatch(t *testing.T) {
411417 {"123456789012.dkr.ecr-fips.lala-land-1.amazonaws.com" , true },
412418 // .cn
413419 {"123456789012.dkr.ecr.lala-land-1.amazonaws.com.cn" , true },
420+ // .eu
421+ {"123456789012.dkr.ecr.eusc-de-east-1.amazonaws.eu" , true },
422+ // .eu with fips
423+ {"123456789012.dkr.ecr-fips.eusc-de-east-1.amazonaws.eu" , true },
414424 // registry ID too long
415425 {"1234567890123.dkr.ecr.lala-land-1.amazonaws.com" , false },
416426 // registry ID too short
You can’t perform that action at this time.
0 commit comments