mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
Refactor parseHostSpec
Fix ssh parsing in issue 4847
This commit is contained in:
@@ -89,6 +89,10 @@ func TestNewRepoSpecFromUrlErrors(t *testing.T) {
|
||||
"htxxxtp://github.com/",
|
||||
"url lacks host",
|
||||
},
|
||||
"bad_scp": {
|
||||
"git@local/path:file/system",
|
||||
"url lacks host",
|
||||
},
|
||||
"no_org_repo": {
|
||||
"ssh://git.example.com",
|
||||
"url lacks repoPath",
|
||||
@@ -191,27 +195,40 @@ func TestNewRepoSpecFromUrl_Smoke(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "t6",
|
||||
input: "git@gitlab2.sqtools.ru:10022/infra/kubernetes/thanos-base.git?ref=v0.1.0",
|
||||
cloneSpec: "git@gitlab2.sqtools.ru:10022/infra/kubernetes/thanos-base.git",
|
||||
input: "git@gitlab2.sqtools.ru:infra/kubernetes/thanos-base.git?ref=v0.1.0",
|
||||
cloneSpec: "git@gitlab2.sqtools.ru:infra/kubernetes/thanos-base.git",
|
||||
absPath: notCloned.String(),
|
||||
repoSpec: RepoSpec{
|
||||
Host: "git@gitlab2.sqtools.ru:10022/",
|
||||
RepoPath: "infra/kubernetes/thanos-base",
|
||||
Host: "git@gitlab2.sqtools.ru:",
|
||||
RepoPath: "infra/kubernetes/thanos-base",
|
||||
Ref: "v0.1.0",
|
||||
GitSuffix: ".git",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "t7",
|
||||
name: "non-github_scp",
|
||||
input: "git@bitbucket.org:company/project.git//path?ref=branch",
|
||||
cloneSpec: "git@bitbucket.org:company/project.git",
|
||||
absPath: notCloned.Join("path"),
|
||||
repoSpec: RepoSpec{
|
||||
Host: "git@bitbucket.org:company/",
|
||||
RepoPath: "project",
|
||||
KustRootPath: "/path",
|
||||
Ref: "branch",
|
||||
GitSuffix: ".git",
|
||||
Host: "git@bitbucket.org:",
|
||||
RepoPath: "company/project",
|
||||
KustRootPath: "/path",
|
||||
Ref: "branch",
|
||||
GitSuffix: ".git",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "non-github_git-user_ssh",
|
||||
input: "ssh://git@bitbucket.org/company/project.git//path?ref=branch",
|
||||
cloneSpec: "ssh://git@bitbucket.org/company/project.git",
|
||||
absPath: notCloned.Join("path"),
|
||||
repoSpec: RepoSpec{
|
||||
Host: "ssh://git@bitbucket.org/",
|
||||
RepoPath: "company/project",
|
||||
KustRootPath: "/path",
|
||||
Ref: "branch",
|
||||
GitSuffix: ".git",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user