Обновить internal/endpoint/endpoint.go
This commit is contained in:
@@ -600,22 +600,8 @@ func (s *Receiver) clientRootFromCtx(ctx context.Context) *zfs.DatasetPath {
|
|||||||
return s.conf.RootWithoutClientComponent.Copy()
|
return s.conf.RootWithoutClientComponent.Copy()
|
||||||
}
|
}
|
||||||
|
|
||||||
var clientIdentity string
|
// Патч: всегда возвращаем только root_fs без client_identity
|
||||||
if s.Test_OverrideClientIdentityFunc != nil {
|
return s.conf.RootWithoutClientComponent.Copy()
|
||||||
clientIdentity = s.Test_OverrideClientIdentityFunc()
|
|
||||||
} else {
|
|
||||||
var ok bool
|
|
||||||
clientIdentity, ok = ctx.Value(ClientIdentityKey).(string) // no shadow
|
|
||||||
if !ok {
|
|
||||||
panic("ClientIdentityKey context value must be set")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
clientRoot, err := clientRoot(s.conf.RootWithoutClientComponent, clientIdentity)
|
|
||||||
if err != nil {
|
|
||||||
panic(fmt.Sprintf("ClientIdentityContextKey must have been validated before invoking Receiver: %s", err))
|
|
||||||
}
|
|
||||||
return clientRoot
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type subroot struct {
|
type subroot struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user