Skip to content

Commit

Permalink
removed imagecount
Browse files Browse the repository at this point in the history
  • Loading branch information
munishchouhan committed Jan 14, 2025
1 parent 9f4850e commit e6ba233
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions pkg/filler/filler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
9 changes: 0 additions & 9 deletions pkg/registry/async/async_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions pkg/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 0 additions & 1 deletion pkg/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ type BaseData struct {
AbsoluteDir string
RegistryName string
LastUpdated string
ImageCount int
}

type IndexData struct {
Expand Down
3 changes: 0 additions & 3 deletions pkg/templates/tmpl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<header class="bg-white shadow">
<div class="container mx-auto px-4 py-6 sm:px-6 lg:px-8">
<h1 class="lg:text-3xl xs:text-sm font-bold tracking-tight text-gray-900">{{.RegistryName}}</h1>
<div class="mt-2 inline-flex items-center text-xs font-medium">
Images hosted: {{.ImageCount}}
</div>
</div>
</header>
<main class="container mx-auto">
Expand Down

0 comments on commit e6ba233

Please sign in to comment.