Skip to content

Commit

Permalink
fix: update regex to excape the dot in it (#975)
Browse files Browse the repository at this point in the history
Signed-off-by: Wang, Shu <[email protected]>
  • Loading branch information
wangshu3000 authored Jul 26, 2024
1 parent daab0c9 commit 2f13857
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions downloader/oci_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ func (d *OCIDetector) Detect(src, _ string) (string, bool, error) {

func containsOCIRegistry(src string) bool {
matchRegistries := []*regexp.Regexp{
regexp.MustCompile("azurecr.io"),
regexp.MustCompile("gcr.io"),
regexp.MustCompile("registry.gitlab.com"),
regexp.MustCompile("pkg.dev"),
regexp.MustCompile("[0-9]{12}.dkr.ecr.[a-z0-9-]*.amazonaws.com"),
regexp.MustCompile("^quay.io"),
regexp.MustCompile(`azurecr\.io`),
regexp.MustCompile(`gcr\.io`),
regexp.MustCompile(`registry\.gitlab\.com`),
regexp.MustCompile(`pkg\.dev`),
regexp.MustCompile(`[0-9]{12}\.dkr\.ecr\.[a-z0-9-]*\.amazonaws\.com`),
regexp.MustCompile(`^quay\.io`),
}

for _, matchRegistry := range matchRegistries {
Expand Down

0 comments on commit 2f13857

Please sign in to comment.