Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 903fd4f

Browse files
authored
Capture public aws ecr image repository uri DEV-1247 (#16)
## Summary Aws ECR regex should match private and public repository uri. Public ECR URI prefixes with `public.ecr.aws/` ## How was it tested? launchpad up ## Is this change backwards-compatible? yes
1 parent 827171a commit 903fd4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

launchpad/publish.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ const (
5959
)
6060

6161
// Regex derived from https://github.com/aws/aws-sam-cli/blob/2592135cd21cb5fb1559e866cce2d5383ee49536/samcli/lib/package/regexpr.py
62+
// This matches private ecr repos and public one.
6263
var ecrURIRegex = regexp.MustCompile(
63-
`(^[a-zA-Z0-9][a-zA-Z0-9-_]*)\.dkr\.ecr\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.amazonaws\.com(\.cn)?` +
64-
`\/(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)*[a-z0-9]+(?:[._-][a-z0-9]+)*`,
64+
`((^[a-zA-Z0-9][a-zA-Z0-9-_]*)\.dkr\.ecr\.([a-zA-Z0-9][a-zA-Z0-9-_]*)\.amazonaws\.com(\.cn)?` +
65+
`\/(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)*[a-z0-9]+(?:[._-][a-z0-9]+)*)|public\.ecr\.aws\/.*`,
6566
)
6667

6768
// Regex based on https://cloud.google.com/artifact-registry/docs/docker/names

0 commit comments

Comments
 (0)