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:
Bogdan Bivolaru
2022-09-30 20:32:32 +03:00
committed by GitHub
parent 885f139e0e
commit 67294cc669
12 changed files with 805 additions and 227 deletions
+9
View File
@@ -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()