mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-19 15:17:43 +01:00
fix[replication] gitlab pull-based multi namespace
Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
parent
a6c7e15d7e
commit
e7f8869ff7
@ -109,9 +109,6 @@ func (a *adapter) FetchArtifacts(filters []*model.Filter) ([]*model.Resource, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, project := range projects {
|
for _, project := range projects {
|
||||||
if !existPatterns(project.FullPath, pathPatterns) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
repositories, err := a.clientGitlabAPI.getRepositories(project.ID)
|
repositories, err := a.clientGitlabAPI.getRepositories(project.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -168,7 +165,7 @@ func (a *adapter) searchByPattern(pattern string) []*Project {
|
|||||||
if ok {
|
if ok {
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
substrings := strings.Split(name, "/")
|
substrings := strings.Split(name, "/")
|
||||||
if len(substrings) != 2 {
|
if len(substrings) < 2 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var projectsByName, err = a.clientGitlabAPI.getProjectsByName(substrings[1])
|
var projectsByName, err = a.clientGitlabAPI.getProjectsByName(substrings[1])
|
||||||
@ -182,7 +179,7 @@ func (a *adapter) searchByPattern(pattern string) []*Project {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
substrings := strings.Split(pattern, "/")
|
substrings := strings.Split(pattern, "/")
|
||||||
if len(substrings) != 2 {
|
if len(substrings) < 2 {
|
||||||
return projects
|
return projects
|
||||||
}
|
}
|
||||||
projectName := substrings[1]
|
projectName := substrings[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user