Skip to content

Commit

Permalink
Add support for AWS ISO-E and ISO-F partitions (#850)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Vazquez <[email protected]>
  • Loading branch information
austinvazquez authored Aug 8, 2024
1 parent 27a1eeb commit e5b7415
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ecr-login/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 27 additions & 0 deletions ecr-login/api/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit e5b7415

Please sign in to comment.