mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-20 15:48:26 +01:00
Fix bug of listing tags filtered by label
Fixes #8249 Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
parent
b15c6bcdc7
commit
a5d292c9c6
@ -584,7 +584,12 @@ func (ra *RepositoryAPI) GetTags() {
|
|||||||
}
|
}
|
||||||
labeledTags := map[string]struct{}{}
|
labeledTags := map[string]struct{}{}
|
||||||
for _, rl := range rls {
|
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{}
|
ts := []string{}
|
||||||
for _, tag := range tags {
|
for _, tag := range tags {
|
||||||
|
Loading…
Reference in New Issue
Block a user