feat(repodb): sync-repodb WIP (#1241)

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
LaurentiuNiculae
2023-03-09 20:41:48 +02:00
committed by GitHub
parent fd5a2af10b
commit 4c156234cb
30 changed files with 652 additions and 315 deletions
+3
View File
@@ -6,6 +6,7 @@ package test_test
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"path"
@@ -23,6 +24,8 @@ import (
"zotregistry.io/zot/pkg/test"
)
var ErrTestError = errors.New("test error")
func TestCopyFiles(t *testing.T) {
Convey("sourceDir does not exist", t, func() {
err := test.CopyFiles("/path/to/some/unexisting/directory", os.TempDir())
+6 -4
View File
@@ -19,7 +19,7 @@ type RepoDBMock struct {
SetRepoLogoFn func(repo string, logoPath string) error
SetRepoTagFn func(repo string, tag string, manifestDigest godigest.Digest, mediaType string) error
SetRepoReferenceFn func(repo string, Reference string, manifestDigest godigest.Digest, mediaType string) error
DeleteRepoTagFn func(repo string, tag string) error
@@ -111,9 +111,11 @@ func (sdm RepoDBMock) SetRepoLogo(repo string, logoPath string) error {
return nil
}
func (sdm RepoDBMock) SetRepoTag(repo string, tag string, manifestDigest godigest.Digest, mediaType string) error {
if sdm.SetRepoTagFn != nil {
return sdm.SetRepoTagFn(repo, tag, manifestDigest, mediaType)
func (sdm RepoDBMock) SetRepoReference(repo string, reference string, manifestDigest godigest.Digest,
mediaType string,
) error {
if sdm.SetRepoReferenceFn != nil {
return sdm.SetRepoReferenceFn(repo, reference, manifestDigest, mediaType)
}
return nil