From e7f8869ff7f99bbde1ed7db3ddd2b27dc02c5307 Mon Sep 17 00:00:00 2001 From: Ziming Zhang Date: Tue, 28 Jul 2020 15:49:12 +0800 Subject: [PATCH] fix[replication] gitlab pull-based multi namespace Signed-off-by: Ziming Zhang --- src/replication/adapter/gitlab/adapter.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/replication/adapter/gitlab/adapter.go b/src/replication/adapter/gitlab/adapter.go index a7e7ab44e..196257351 100644 --- a/src/replication/adapter/gitlab/adapter.go +++ b/src/replication/adapter/gitlab/adapter.go @@ -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]