disable schema1 by default, add a config flag to enable it

port of #2473

Signed-off-by: Viktor Stanchev <me@viktorstanchev.com>
This commit is contained in:
Viktor Stanchev
2017-12-18 15:06:04 -08:00
parent f411848591
commit e9864ce8b9
15 changed files with 103 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ type setupEnv struct {
func setupFS(t *testing.T) *setupEnv {
d := inmemory.New()
ctx := context.Background()
registry, err := NewRegistry(ctx, d, BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider()), EnableRedirect)
registry, err := NewRegistry(ctx, d, BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider()), EnableRedirect, EnableSchema1)
if err != nil {
t.Fatalf("error creating registry: %v", err)
}
@@ -207,7 +207,7 @@ func testEq(a, b []string, size int) bool {
func setupBadWalkEnv(t *testing.T) *setupEnv {
d := newBadListDriver()
ctx := context.Background()
registry, err := NewRegistry(ctx, d, BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider()), EnableRedirect)
registry, err := NewRegistry(ctx, d, BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider()), EnableRedirect, EnableSchema1)
if err != nil {
t.Fatalf("error creating registry: %v", err)
}