Merge pull request #8733 from ywk253100/190819_label

Fix bug of listing tags filtered by label
This commit is contained in:
Wang Yan 2019-08-20 14:17:41 +08:00 committed by GitHub
commit 92fa01d6cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -584,7 +584,12 @@ func (ra *RepositoryAPI) GetTags() {
}
labeledTags := map[string]struct{}{}
for _, rl := range rls {
labeledTags[strings.Split(rl.ResourceName, ":")[1]] = struct{}{}
strs := strings.SplitN(rl.ResourceName, ":", 2)
// the "rls" may contain images which don't belong to the repository
if strs[0] != repoName {
continue
}
labeledTags[strs[1]] = struct{}{}
}
ts := []string{}
for _, tag := range tags {