Skip to content

Commit 95f90ba

Browse files
authored
Adding support for additional ACR TLD's (#340)
1 parent f27e717 commit 95f90ba

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pkg/client/acr/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
var (
9-
reg = regexp.MustCompile(`^.*\.azurecr.io$`)
9+
reg = regexp.MustCompile(`.*\.azurecr\.io|.*\.azurecr\.cn|.*\.azurecr\.de|.*\.azurecr\.us`)
1010
)
1111

1212
func (c *Client) IsHost(host string) bool {

pkg/client/acr/path_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ func TestIsHost(t *testing.T) {
2727
host: "versionchecker.azurecr.io",
2828
expIs: true,
2929
},
30+
"azurecr.cn with random sub domains should be true": {
31+
host: "versionchecker.azurecr.cn",
32+
expIs: true,
33+
},
34+
"azurecr.de with random sub domains should be true": {
35+
host: "versionchecker.azurecr.de",
36+
expIs: true,
37+
},
38+
"azurecr.us with random sub domains should be true": {
39+
host: "versionchecker.azurecr.us",
40+
expIs: true,
41+
},
3042
"foodazurecr.io should be false": {
3143
host: "fooazurecr.io",
3244
expIs: false,

0 commit comments

Comments
 (0)