mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 09:51:23 +00:00
improve url parsing function in gitcloner
This commit is contained in:
@@ -52,6 +52,14 @@ func TestIsRepoURL(t *testing.T) {
|
||||
input: "git::https://gitlab.com/org/repo",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
input: "git@gitlab2.sqtools.ru:10022/infra/kubernetes/thanos-base.git?ref=v0.1.0",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
input: "git@bitbucket.org:org/repo.git",
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
input: "/github.com/org/repo",
|
||||
expected: false,
|
||||
@@ -283,6 +291,12 @@ func TestParseUrl(t *testing.T) {
|
||||
path: "somedir",
|
||||
ref: "",
|
||||
},
|
||||
{
|
||||
input: "git@gitlab2.sqtools.ru:10022/infra/kubernetes/thanos-base.git?ref=v0.1.0",
|
||||
repo: "git@gitlab2.sqtools.ru:10022/infra/kubernetes/thanos-base.git",
|
||||
path: "",
|
||||
ref: "v0.1.0",
|
||||
},
|
||||
}
|
||||
for _, testcase := range testcases {
|
||||
repo, path, ref, err := parseUrl(testcase.input)
|
||||
|
||||
Reference in New Issue
Block a user