mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
feat(repodb): sync-repodb WIP (#1241)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user