Skip to content

Consider all SHA's of a manifest #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Consider all SHA's of a manifest #355

wants to merge 16 commits into from

Conversation

davidcollom
Copy link
Collaborator

@davidcollom davidcollom commented Apr 4, 2025

This was initially started in bringing OS/Arch Support to version-checker, but as things progressed.

I releasied that whilst it would be nice and efficient if we only returned Tags that were for the macthing OS, it felt like we'd be caching more and more of the same data (albeit for different os/arch)

Therefore, adding a Children/Child field to an ImageTag allows us to add multiple SHA's to the same tag (essentially brining multi-arch). Caching this as all one object also means we cache it once!

if a Tag were to be updated, then all SHA Digests would be updated and modified so the same outcome occurs as before.

I have tested this with the following Clients:

  • Docker
  • GCR
  • Quay
  • SelfHosted (via Harbour)
  • GHCR
  • ECR

resolves #212

@davidcollom davidcollom added this to the v1 milestone Apr 4, 2025
@@ -14,6 +14,7 @@ type TagResponse struct {
type Result struct {
Name string `json:"name"`
Timestamp string `json:"last_updated"`
Digest string `json:"digest,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discovered it whilst looking up / using some test/sample data - I.E: within the current response:

https://registry.hub.docker.com/v2/repositories/davidcollom/hub3-exporter/tags


// If this is a Manifest list we need to keep them together
Children []*ImageTag `json:"children,omitempty"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that it would be better to represent this as

type ImageTag struct {
    Tag string
    Manifests []Manifest
}

type Manifest {
   SHA string
   Timestamp time.Time
   OS OS
   Architecture Architecture
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants