Fix assets vs data issue

And possibly some other related file mount issues.

Fixes #12133
This commit is contained in:
Bjørn Erik Pedersen
2024-02-28 17:58:27 +01:00
parent be1dbba0f7
commit 4a502f7eb4
2 changed files with 19 additions and 4 deletions

View File

@@ -43,7 +43,6 @@ var _ ReverseLookupProvder = (*RootMappingFs)(nil)
func NewRootMappingFs(fs afero.Fs, rms ...RootMapping) (*RootMappingFs, error) {
rootMapToReal := radix.New()
realMapToRoot := radix.New()
var virtualRoots []RootMapping
addMapping := func(key string, rm RootMapping, to *radix.Tree) {
var mappings []RootMapping
@@ -154,11 +153,8 @@ func NewRootMappingFs(fs afero.Fs, rms ...RootMapping) (*RootMappingFs, error) {
addMapping(rev, rm, realMapToRoot)
virtualRoots = append(virtualRoots, rm)
}
rootMapToReal.Insert(filepathSeparator, virtualRoots)
rfs := &RootMappingFs{
Fs: fs,
rootMapToReal: rootMapToReal,
@@ -414,6 +410,7 @@ func (fs *RootMappingFs) getRoots(key string) (string, []RootMapping) {
for {
var found bool
ss, vv, found := tree.LongestPrefix(key)
if !found || (levels < 2 && ss == key) {
break
}