-
Notifications
You must be signed in to change notification settings - Fork 80
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
base: main
Are you sure you want to change the base?
Conversation
pkg/client/docker/types.go
Outdated
@@ -14,6 +14,7 @@ type TagResponse struct { | |||
type Result struct { | |||
Name string `json:"name"` | |||
Timestamp string `json:"last_updated"` | |||
Digest string `json:"digest,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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"` | ||
} |
There was a problem hiding this comment.
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
}
Signed-off-by: paulwilljones <[email protected]> Co-authored-by: David Collom <[email protected]>
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:
resolves #212