mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
Merge pull request #303 from gitirabassi/all-git-repos
if the prefix of the base is 'git::' will make the use of go-getter to download repo
This commit is contained in:
@@ -78,6 +78,9 @@ func isRepoUrl(s string) bool {
|
|||||||
if strings.HasPrefix(s, "https://") {
|
if strings.HasPrefix(s, "https://") {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(s, "git::") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
host := strings.SplitN(s, "/", 2)[0]
|
host := strings.SplitN(s, "/", 2)[0]
|
||||||
return strings.Contains(host, ".com") || strings.Contains(host, ".org")
|
return strings.Contains(host, ".com") || strings.Contains(host, ".org")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ func TestIsRepoURL(t *testing.T) {
|
|||||||
input: "../relative",
|
input: "../relative",
|
||||||
expected: false,
|
expected: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
input: "git::https://gitlab.com/org/repo",
|
||||||
|
expected: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testcases {
|
for _, tc := range testcases {
|
||||||
actual := isRepoUrl(tc.input)
|
actual := isRepoUrl(tc.input)
|
||||||
|
|||||||
Reference in New Issue
Block a user