Added new extension "sync"

Periodically poll registries and pull images according to sync's config
Added sync on demand, syncing when clients asks for an image which
zot doesn't have.

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Petu Eusebiu
2021-06-08 23:11:18 +03:00
committed by Ramkumar Chinchani
parent 1027f872ec
commit 19003e8a71
34 changed files with 3158 additions and 339 deletions
+8 -7
View File
@@ -16,7 +16,8 @@ import (
zotErrors "github.com/anuvu/zot/errors"
"github.com/anuvu/zot/pkg/api"
ext "github.com/anuvu/zot/pkg/extensions"
"github.com/anuvu/zot/pkg/api/config"
extconf "github.com/anuvu/zot/pkg/extensions/config"
"gopkg.in/resty.v1"
. "github.com/smartystreets/goconvey/convey"
@@ -286,9 +287,9 @@ func TestSearchCVECmd(t *testing.T) {
func TestServerCVEResponse(t *testing.T) {
port := getFreePort()
url := getBaseURL(port)
config := api.NewConfig()
config.HTTP.Port = port
c := api.NewController(config)
conf := config.New()
conf.HTTP.Port = port
c := api.NewController(conf)
dir, err := ioutil.TempDir("", "oci-repo-test")
if err != nil {
@@ -303,14 +304,14 @@ func TestServerCVEResponse(t *testing.T) {
defer os.RemoveAll(dir)
c.Config.Storage.RootDirectory = dir
cveConfig := &ext.CVEConfig{
cveConfig := &extconf.CVEConfig{
UpdateInterval: 2,
}
searchConfig := &ext.SearchConfig{
searchConfig := &extconf.SearchConfig{
CVE: cveConfig,
Enable: true,
}
c.Config.Extensions = &ext.ExtensionConfig{
c.Config.Extensions = &extconf.ExtensionConfig{
Search: searchConfig,
}