mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
replace dependency of tagsInfo and repoInfo with just a list of manifests
- replace dependency of tagsInfo and repoInfo with a list of manifests, since it provides all the needed data - Mock tests added Signed-off-by: Alex Stan <alexandrustan96@yahoo.ro>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
86401de3b0
commit
a5ed99178e
@@ -23,10 +23,11 @@ type OciLayoutUtilsMock struct {
|
||||
GetRepoLastUpdatedFn func(repo string) (common.TagInfo, error)
|
||||
GetExpandedRepoInfoFn func(name string) (common.RepoInfo, error)
|
||||
GetImageConfigInfoFn func(repo string, manifestDigest godigest.Digest) (ispec.Image, error)
|
||||
CheckManifestSignatureFn func(name string, digest godigest.Digest) bool
|
||||
}
|
||||
|
||||
func (olum OciLayoutUtilsMock) GetImageManifests(image string) ([]ispec.Descriptor, error) {
|
||||
if olum.GetImageBlobManifestFn != nil {
|
||||
if olum.GetImageManifestsFn != nil {
|
||||
return olum.GetImageManifestsFn(image)
|
||||
}
|
||||
|
||||
@@ -128,3 +129,11 @@ func (olum OciLayoutUtilsMock) GetImageConfigInfo(repo string, manifestDigest go
|
||||
|
||||
return ispec.Image{}, nil
|
||||
}
|
||||
|
||||
func (olum OciLayoutUtilsMock) CheckManifestSignature(name string, digest godigest.Digest) bool {
|
||||
if olum.CheckManifestSignatureFn != nil {
|
||||
return olum.CheckManifestSignatureFn(name, digest)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user