From e6ba2336cfc44f076f2a29e40b1d5b320a610efe Mon Sep 17 00:00:00 2001 From: munishchouhan Date: Tue, 14 Jan 2025 11:22:32 +0100 Subject: [PATCH] removed imagecount --- pkg/filler/filler.go | 2 -- pkg/registry/async/async_registry.go | 9 --------- pkg/registry/client.go | 3 --- pkg/templates/templates.go | 1 - pkg/templates/tmpl/index.html | 3 --- 5 files changed, 18 deletions(-) diff --git a/pkg/filler/filler.go b/pkg/filler/filler.go index 3908c68..82eb843 100644 --- a/pkg/filler/filler.go +++ b/pkg/filler/filler.go @@ -62,12 +62,10 @@ func (f *Filler) TagData(ctx context.Context, repo string, tag string) (*templat } func (f *Filler) BaseData() templates.BaseData { - imageCount := f.regClient.ImageCount() return templates.BaseData{ AbsoluteDir: f.absoluteDir, RegistryName: f.registryHostname, LastUpdated: time.Now().Format(time.RFC3339), - ImageCount: imageCount, } } diff --git a/pkg/registry/async/async_registry.go b/pkg/registry/async/async_registry.go index d2b64ea..71f78bd 100644 --- a/pkg/registry/async/async_registry.go +++ b/pkg/registry/async/async_registry.go @@ -260,15 +260,6 @@ func (c *Async) ImageInfo(ctx context.Context, repo string, tag string) (image v return info.image, info.reference, nil } -func (c *Async) ImageCount() int { - count := 0 - c.repositoryTags.Range(func(_ string, tags []string) bool { - count += len(tags) - return true - }) - return count -} - func New( client *registryimpl.Registry, refreshInterval time.Duration, diff --git a/pkg/registry/client.go b/pkg/registry/client.go index 39002c3..ce7311e 100644 --- a/pkg/registry/client.go +++ b/pkg/registry/client.go @@ -37,7 +37,4 @@ type Client interface { // ImageInfo retrieves detailed information about a specific image identified by its repository and tag ImageInfo(ctx context.Context, repo string, tag string) (image v1.Image, reference string, err error) - - // ImageCount returns the number of images in the registry - ImageCount() int } diff --git a/pkg/templates/templates.go b/pkg/templates/templates.go index 557efac..6e0f68e 100644 --- a/pkg/templates/templates.go +++ b/pkg/templates/templates.go @@ -48,7 +48,6 @@ type BaseData struct { AbsoluteDir string RegistryName string LastUpdated string - ImageCount int } type IndexData struct { diff --git a/pkg/templates/tmpl/index.html b/pkg/templates/tmpl/index.html index 9b937c8..274f09b 100644 --- a/pkg/templates/tmpl/index.html +++ b/pkg/templates/tmpl/index.html @@ -13,9 +13,6 @@

{{.RegistryName}}

-
- Images hosted: {{.ImageCount}} -