From 99a577371918808616222a673523da715c7f1008 Mon Sep 17 00:00:00 2001 From: "p.fomin" Date: Thu, 7 Mar 2019 19:34:03 +0700 Subject: [PATCH] do not show repo if no tag exist --- registry/client.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/registry/client.go b/registry/client.go index d6af4b9..1e881d2 100644 --- a/registry/client.go +++ b/registry/client.go @@ -183,7 +183,9 @@ func (c *Client) Repositories(useCache bool) map[string][]string { namespace = f[0] repo = f[1] } - c.repos[namespace] = append(c.repos[namespace], repo) + if len(c.Tags(r.String())) > 0 { + c.repos[namespace] = append(c.repos[namespace], repo) + } } // pagination @@ -249,7 +251,9 @@ func (c *Client) CountTags(interval uint8) { if n != "library" { repoPath = fmt.Sprintf("%s/%s", n, r) } - c.tagCounts[fmt.Sprintf("%s/%s", n, r)] = len(c.Tags(repoPath)) + if len(c.Tags(repoPath)) > 0 { + c.tagCounts[fmt.Sprintf("%s/%s", n, r)] = len(c.Tags(repoPath)) + } } } c.logger.Info("Tags calculation complete.")