From e5b7415aa0b8a07de2840b7ef6a9fc17b2dbbf49 Mon Sep 17 00:00:00 2001 From: Austin Vazquez <55906459+austinvazquez@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:20:43 -0700 Subject: [PATCH] Add support for AWS ISO-E and ISO-F partitions (#850) Signed-off-by: Austin Vazquez --- ecr-login/api/client.go | 2 +- ecr-login/api/client_test.go | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ecr-login/api/client.go b/ecr-login/api/client.go index bdf65ccd..ae452396 100644 --- a/ecr-login/api/client.go +++ b/ecr-login/api/client.go @@ -37,7 +37,7 @@ const ( ecrPublicEndpoint = proxyEndpointScheme + ecrPublicName ) -var ecrPattern = regexp.MustCompile(`^(\d{12})\.dkr\.ecr(\-fips)?\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.(amazonaws\.com(\.cn)?|sc2s\.sgov\.gov|c2s\.ic\.gov)$`) +var ecrPattern = regexp.MustCompile(`^(\d{12})\.dkr\.ecr(\-fips)?\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.(amazonaws\.com(\.cn)?|sc2s\.sgov\.gov|c2s\.ic\.gov|cloud\.adc-e\.uk|csp\.hci\.ic\.gov)$`) type Service string diff --git a/ecr-login/api/client_test.go b/ecr-login/api/client_test.go index dec5db54..a9a0ab39 100644 --- a/ecr-login/api/client_test.go +++ b/ecr-login/api/client_test.go @@ -78,6 +78,33 @@ func TestExtractRegistry(t *testing.T) { Service: ServiceECR, }, hasError: false, + }, { + serverURL: "123456789012.dkr.ecr.us-isob-east-1.sc2s.sgov.gov", + registry: &Registry{ + ID: "123456789012", + FIPS: false, + Region: "us-isob-east-1", + Service: ServiceECR, + }, + hasError: false, + }, { + serverURL: "123456789012.dkr.ecr.eu-isoe-west-1.cloud.adc-e.uk", + registry: &Registry{ + ID: "123456789012", + FIPS: false, + Region: "eu-isoe-west-1", + Service: ServiceECR, + }, + hasError: false, + }, { + serverURL: "123456789012.dkr.ecr.us-isof-east-1.csp.hci.ic.gov", + registry: &Registry{ + ID: "123456789012", + FIPS: false, + Region: "us-isof-east-1", + Service: ServiceECR, + }, + hasError: false, }, { serverURL: "123456789012.dkr.ecr-fips.us-gov-west-1.amazonaws.com", registry: &Registry{