mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
Add graphql query for retrieving imgSummary based on repo:tag image id. (#814)
Refactor Image GqlResolver to better suit GetManifest. Changed GetManifest to also return digest. Signed-off-by: Bogdan BIVOLARU <104334+bogdanbiv@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type OciLayoutUtilsMock struct {
|
||||
GetImageManifestFn func(repo string, reference string) (ispec.Manifest, string, error)
|
||||
GetImageManifestsFn func(image string) ([]ispec.Descriptor, error)
|
||||
GetImageBlobManifestFn func(imageDir string, digest godigest.Digest) (v1.Manifest, error)
|
||||
GetImageInfoFn func(imageDir string, hash v1.Hash) (ispec.Image, error)
|
||||
@@ -26,6 +27,14 @@ type OciLayoutUtilsMock struct {
|
||||
GetRepositoriesFn func() ([]string, error)
|
||||
}
|
||||
|
||||
func (olum OciLayoutUtilsMock) GetImageManifest(repo string, reference string) (ispec.Manifest, string, error) {
|
||||
if olum.GetImageManifestFn != nil {
|
||||
return olum.GetImageManifestFn(repo, reference)
|
||||
}
|
||||
|
||||
return ispec.Manifest{}, "", nil
|
||||
}
|
||||
|
||||
func (olum OciLayoutUtilsMock) GetRepositories() ([]string, error) {
|
||||
if olum.GetRepositoriesFn != nil {
|
||||
return olum.GetRepositoriesFn()
|
||||
|
||||
Reference in New Issue
Block a user