Merge pull request #4986 from KnVerey/repospec_custom_usernames

repospec: support ssh urls with ssh certificates
This commit is contained in:
Kubernetes Prow Robot
2023-01-20 13:23:54 -08:00
committed by GitHub
2 changed files with 29 additions and 4 deletions

View File

@@ -33,6 +33,8 @@ func TestNewRepoSpecFromUrl_Permute(t *testing.T) {
{"git@github.com:", "git@github.com:"},
{"git@github.com/", "git@github.com:"},
{"git::git@github.com:", "git@github.com:"},
{"org-12345@github.com:", "org-12345@github.com:"},
{"org-12345@github.com/", "org-12345@github.com:"},
}
var repoPaths = []string{"someOrg/someRepo", "kubernetes/website"}
var pathNames = []string{"README.md", "foo/krusty.txt", ""}
@@ -637,6 +639,28 @@ func TestNewRepoSpecFromUrl_Smoke(t *testing.T) {
KustRootPath: "path/to/kustomization/root",
},
},
{
name: "ssh on github with custom username for custom ssh certificate authority",
input: "ssh://org-12345@github.com/kubernetes-sigs/kustomize",
cloneSpec: "org-12345@github.com:kubernetes-sigs/kustomize.git",
absPath: notCloned.String(),
repoSpec: RepoSpec{
Host: "org-12345@github.com:",
RepoPath: "kubernetes-sigs/kustomize",
GitSuffix: ".git",
},
},
{
name: "scp on github with custom username for custom ssh certificate authority",
input: "org-12345@github.com/kubernetes-sigs/kustomize",
cloneSpec: "org-12345@github.com:kubernetes-sigs/kustomize.git",
absPath: notCloned.String(),
repoSpec: RepoSpec{
Host: "org-12345@github.com:",
RepoPath: "kubernetes-sigs/kustomize",
GitSuffix: ".git",
},
},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {