filer confi: support hierachical configuration

This commit is contained in:
Chris Lu
2020-11-16 16:50:12 -08:00
parent ed1ce3f299
commit 5f19e81dab
5 changed files with 148 additions and 131 deletions

View File

@@ -20,10 +20,15 @@ func TestFilerConf(t *testing.T) {
LocationPrefix: "/buckets/abcd",
Collection: "abcd",
},
{
LocationPrefix: "/buckets/",
Replication: "001",
},
}}
fc.doLoadConf(conf)
assert.Equal(t, "abc", fc.MatchStorageRule("/buckets/abc/jasdf").Collection)
assert.Equal(t, "abcd", fc.MatchStorageRule("/buckets/abcd/jasdf").Collection)
assert.Equal(t, "001", fc.MatchStorageRule("/buckets/abc/jasdf").Replication)
}