fix[replicatioin] aliyun acr pull with repo filter

Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
Ziming Zhang 2020-07-30 00:07:54 +08:00
parent a6c7e15d7e
commit d16753ae96

View File

@ -256,22 +256,16 @@ func (a *adapter) FetchArtifacts(filters []*model.Filter) (resources []*model.Re
log.Debugf("\nnamespace: %s \t repositories: %#v\n\n", namespace, repos)
if _, ok := util.IsSpecificPathComponent(namespacePattern); ok {
log.Debugf("specific namespace: %s", repoPattern)
repositories = append(repositories, repos...)
} else {
for _, repo := range repos {
var ok bool
var repoName = filepath.Join(repo.RepoNamespace, repo.RepoName)
ok, err = util.Match(repoPattern, repoName)
log.Debugf("\n Repository: %s\t repoPattern: %s\t Match: %v\n", repoName, repoPattern, ok)
if err != nil {
return
}
if ok {
repositories = append(repositories, repo)
}
for _, repo := range repos {
var ok bool
var repoName = filepath.Join(repo.RepoNamespace, repo.RepoName)
ok, err = util.Match(repoPattern, repoName)
log.Debugf("\n Repository: %s\t repoPattern: %s\t Match: %v\n", repoName, repoPattern, ok)
if err != nil {
return
}
if ok {
repositories = append(repositories, repo)
}
}
}