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) log.Debugf("\nnamespace: %s \t repositories: %#v\n\n", namespace, repos)
if _, ok := util.IsSpecificPathComponent(namespacePattern); ok { for _, repo := range repos {
log.Debugf("specific namespace: %s", repoPattern) var ok bool
repositories = append(repositories, repos...) var repoName = filepath.Join(repo.RepoNamespace, repo.RepoName)
} else { ok, err = util.Match(repoPattern, repoName)
for _, repo := range repos { log.Debugf("\n Repository: %s\t repoPattern: %s\t Match: %v\n", repoName, repoPattern, ok)
if err != nil {
var ok bool return
var repoName = filepath.Join(repo.RepoNamespace, repo.RepoName) }
ok, err = util.Match(repoPattern, repoName) if ok {
log.Debugf("\n Repository: %s\t repoPattern: %s\t Match: %v\n", repoName, repoPattern, ok) repositories = append(repositories, repo)
if err != nil {
return
}
if ok {
repositories = append(repositories, repo)
}
} }
} }
} }