control: Take empty namespace for 'root' #910

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:fix/control-svc-root-ns into master 2024-01-19 06:22:13 +00:00

View file

@ -17,7 +17,12 @@ func apeTarget(chainTarget *control.ChainTarget) (engine.Target, error) {
case control.ChainTarget_CONTAINER: case control.ChainTarget_CONTAINER:
return engine.ContainerTarget(chainTarget.GetName()), nil return engine.ContainerTarget(chainTarget.GetName()), nil
case control.ChainTarget_NAMESPACE: case control.ChainTarget_NAMESPACE:
return engine.NamespaceTarget(chainTarget.GetName()), nil namespace := chainTarget.GetName()
// If namespace is empty, we take it for root namespace.
if namespace == "" {
namespace = "root"
}
return engine.NamespaceTarget(namespace), nil
default: default:
} }
return engine.Target{}, status.Error(codes.InvalidArgument, return engine.Target{}, status.Error(codes.InvalidArgument,