mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
Fix sync extension logging (#2537)
* fix: nil pointer dereference on localimagestore fixes https://github.com/project-zot/zot/issues/2527 Signed-off-by: Anders Bennedsgaard <abbennedsgaard@gmail.com> * fix: no logging from sync extension imagestore Signed-off-by: Anders Bennedsgaard <abbennedsgaard@gmail.com> * feat: create local imagestore not found error Signed-off-by: Anders Bennedsgaard <abbennedsgaard@gmail.com> * fix: add test Signed-off-by: Anders Bennedsgaard <abbennedsgaard@gmail.com> --------- Signed-off-by: Anders Bennedsgaard <abbennedsgaard@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e5eacaa082
commit
8262c46ad7
@@ -83,6 +83,14 @@ func TestInjectSyncUtils(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestNilDefaultStore(t *testing.T) {
|
||||
Convey("Nil default store", t, func() {
|
||||
ols := NewOciLayoutStorage(storage.StoreController{})
|
||||
_, err := ols.GetImageReference(testImage, testImageTag)
|
||||
So(err, ShouldEqual, zerr.ErrLocalImgStoreNotFound)
|
||||
})
|
||||
}
|
||||
|
||||
func TestSyncInternal(t *testing.T) {
|
||||
Convey("Verify parseRepositoryReference func", t, func() {
|
||||
repositoryReference := fmt.Sprintf("%s/%s", host, testImage)
|
||||
@@ -214,7 +222,7 @@ func TestDestinationRegistry(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(imageReference, ShouldNotBeNil)
|
||||
|
||||
imgStore := getImageStoreFromImageReference(imageReference, repoName, "1.0")
|
||||
imgStore := getImageStoreFromImageReference(imageReference, repoName, "1.0", log)
|
||||
|
||||
// create a blob/layer
|
||||
upload, err := imgStore.NewBlobUpload(repoName)
|
||||
@@ -393,7 +401,7 @@ func TestDestinationRegistry(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
So(imageReference, ShouldNotBeNil)
|
||||
|
||||
imgStore := getImageStoreFromImageReference(imageReference, repoName, "2.0")
|
||||
imgStore := getImageStoreFromImageReference(imageReference, repoName, "2.0", log)
|
||||
|
||||
// upload image
|
||||
|
||||
|
||||
Reference in New Issue
Block a user