mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
refactor(scrub): replace umoci logic in scrub implementation (#1845)
- implement scrub also for S3 storage by replacing umoci - change scrub implementation for ImageIndex - take the `Subject` into consideration when running scrub - remove test code relying on the umoci library. Since we started relying on images in test/data, and we create our own images using go code we can obtain digests by other means. (cherry picked from commit 489d4e2d23c1b4e48799283f8281024bbef6123f) Signed-off-by: Andrei Aaron <aaaron@luxoft.com> Signed-off-by: Andreea-Lupu <andreealupu1470@yahoo.com>
This commit is contained in:
@@ -33,8 +33,6 @@ import (
|
||||
var ErrTestError = fmt.Errorf("testError")
|
||||
|
||||
func TestBaseOciLayoutUtils(t *testing.T) {
|
||||
manifestDigest := GetTestBlobDigest("zot-test", "config").String()
|
||||
|
||||
Convey("GetImageManifestSize fail", t, func() {
|
||||
mockStoreController := mocks.MockedImageStore{
|
||||
GetBlobContentFn: func(repo string, digest godigest.Digest) ([]byte, error) {
|
||||
@@ -64,6 +62,9 @@ func TestBaseOciLayoutUtils(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("GetImageConfigSize: config GetBlobContent fail", t, func() {
|
||||
image := CreateRandomImage()
|
||||
manifestDigest := image.ConfigDescriptor.Digest.String()
|
||||
|
||||
mockStoreController := mocks.MockedImageStore{
|
||||
GetBlobContentFn: func(repo string, digest godigest.Digest) ([]byte, error) {
|
||||
if digest.String() == manifestDigest {
|
||||
@@ -83,7 +84,7 @@ func TestBaseOciLayoutUtils(t *testing.T) {
|
||||
"layers": [
|
||||
{
|
||||
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
|
||||
"digest": "` + GetTestBlobDigest("zot-test", "layer").String() + `",
|
||||
"digest": "` + image.Manifest.Layers[0].Digest.String() + `",
|
||||
"size": 76097157
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user