Option to configure proxy cache TTL
Currently when registry is run as proxy it tries to cleanup unused blobs from its cache after 7 days which is hard-coded. This PR makes that value configurable. Co-authored-by: Shiming Zhang <wzshiming@foxmail.com> Co-authored-by: Manish Tomar <manish.tomar@docker.com> Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
This commit is contained in:
parent
0c958010ac
commit
8fe4ca4038
8 changed files with 131 additions and 59 deletions
|
@ -272,3 +272,24 @@ func TestProxyManifests(t *testing.T) {
|
|||
t.Fatalf("Expected 2 auth challenges, got %#v", env.manifests.authChallenger)
|
||||
}
|
||||
}
|
||||
|
||||
func TestProxyManifestsWithoutScheduler(t *testing.T) {
|
||||
name := "foo/bar"
|
||||
env := newManifestStoreTestEnv(t, name, "latest")
|
||||
env.manifests.scheduler = nil
|
||||
|
||||
ctx := context.Background()
|
||||
exists, err := env.manifests.Exists(ctx, env.manifestDigest)
|
||||
if err != nil {
|
||||
t.Fatalf("Error checking existence")
|
||||
}
|
||||
if !exists {
|
||||
t.Errorf("Unexpected non-existent manifest")
|
||||
}
|
||||
|
||||
// Get - should succeed without scheduler
|
||||
_, err = env.manifests.Get(ctx, env.manifestDigest)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue