Обновить internal/endpoint/endpoint.go
This commit is contained in:
@@ -643,7 +643,22 @@ func (f subroot) MapToLocal(fs string) (*zfs.DatasetPath, error) {
|
|||||||
if p.Length() == 0 {
|
if p.Length() == 0 {
|
||||||
return nil, errors.Errorf("cannot map empty filesystem")
|
return nil, errors.Errorf("cannot map empty filesystem")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Патч: убираем pool name из source пути
|
||||||
|
if p.Length() > 1 {
|
||||||
|
subpath := p.Copy()
|
||||||
|
subpath.TrimNPrefixComps(1) // удаляем hdd_9XG1J9J1
|
||||||
|
p = subpath
|
||||||
|
}
|
||||||
|
|
||||||
|
// Дополнительно: если localRoot содержит client_identity (172.16.11.5), убираем его
|
||||||
c := f.localRoot.Copy()
|
c := f.localRoot.Copy()
|
||||||
|
if c.Length() > 1 {
|
||||||
|
rootOnly := c.Copy()
|
||||||
|
rootOnly.TrimNPrefixComps(c.Length() - 1) // оставляем только chunk_9XG1J8T0
|
||||||
|
c = rootOnly
|
||||||
|
}
|
||||||
|
|
||||||
c.Extend(p)
|
c.Extend(p)
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user