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
+7 -6
View File
@@ -17,6 +17,7 @@ import (
"time"
"github.com/anuvu/zot/pkg/api"
"github.com/anuvu/zot/pkg/api/config"
godigest "github.com/opencontainers/go-digest"
. "github.com/smartystreets/goconvey/convey"
"gopkg.in/resty.v1"
@@ -129,23 +130,23 @@ func TestAuditLogMessages(t *testing.T) {
panic(err)
}
config := api.NewConfig()
conf := config.New()
outputPath := dir + "/zot.log"
auditPath := dir + "/zot-audit.log"
config.Log = &api.LogConfig{Level: "debug", Output: outputPath, Audit: auditPath}
conf.Log = &config.LogConfig{Level: "debug", Output: outputPath, Audit: auditPath}
config.HTTP.Port = SecurePort
conf.HTTP.Port = SecurePort
htpasswdPath := makeHtpasswdFile()
defer os.Remove(htpasswdPath)
config.HTTP.Auth = &api.AuthConfig{
HTPasswd: api.AuthHTPasswd{
conf.HTTP.Auth = &config.AuthConfig{
HTPasswd: config.AuthHTPasswd{
Path: htpasswdPath,
},
}
c := api.NewController(config)
c := api.NewController(conf)
c.Config.Storage.RootDirectory = dir
go func() {
// this blocks