From a5d292c9c6c9390aebafb8bea2bbec04b914692a Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Mon, 19 Aug 2019 16:10:16 +0800 Subject: [PATCH] Fix bug of listing tags filtered by label Fixes #8249 Signed-off-by: Wenkai Yin --- src/core/api/repository.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/api/repository.go b/src/core/api/repository.go index a77f02c34..46c6976f9 100755 --- a/src/core/api/repository.go +++ b/src/core/api/repository.go @@ -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 {