Merge pull request #12608 from bitsf/fix_gitlab_pull

fix[replication] gitlab pull-based multi namespace
This commit is contained in:
Steven Zou 2020-08-03 18:24:45 +08:00 committed by GitHub
commit a6e85c1f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,9 +109,6 @@ func (a *adapter) FetchArtifacts(filters []*model.Filter) ([]*model.Resource, er
}
for _, project := range projects {
if !existPatterns(project.FullPath, pathPatterns) {
continue
}
repositories, err := a.clientGitlabAPI.getRepositories(project.ID)
if err != nil {
return nil, err
@ -168,7 +165,7 @@ func (a *adapter) searchByPattern(pattern string) []*Project {
if ok {
for _, name := range names {
substrings := strings.Split(name, "/")
if len(substrings) != 2 {
if len(substrings) < 2 {
continue
}
var projectsByName, err = a.clientGitlabAPI.getProjectsByName(substrings[1])
@ -182,7 +179,7 @@ func (a *adapter) searchByPattern(pattern string) []*Project {
}
} else {
substrings := strings.Split(pattern, "/")
if len(substrings) != 2 {
if len(substrings) < 2 {
return projects
}
projectName := substrings[1]