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 10 commits into
base: main
Choose a base branch
from
Open

Consider all SHA's of a manifest #355

wants to merge 10 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 #181

@davidcollom davidcollom added this to the v1 milestone Apr 4, 2025
@davidcollom davidcollom force-pushed the issue-212 branch 2 times, most recently from 003c087 to 92c8431 Compare April 4, 2025 15:36
@@ -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
}

@paulwilljones
Copy link
Contributor

Do you think some of this PR can be moved into another (like GitHub Actions)?

Copy link
Contributor

@paulwilljones paulwilljones left a comment

Choose a reason for hiding this comment

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

There's a lot going on here, not all of it relates to the getting the SHAs in manifests. Could it be broken down into 2-3 other PRs?
Otherwise, only main nit is moving the logic when building the parent/child tag map into one place and reuse it across clients.

@davidcollom
Copy link
Collaborator Author

Do you think some of this PR can be moved into another (like GitHub Actions)?

Once the following PRs are merged, things should be cleaned up nicely!

#367
#369
#368
#365

@davidcollom davidcollom marked this pull request as ready for review April 29, 2025 13:15
@davidcollom davidcollom requested a review from maria-reynoso May 1, 2025 10:32
@davidcollom davidcollom requested a review from paulwilljones May 1, 2025 15:50
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.

Support multiple architecture discovery
3 participants