forked from TrueCloudLab/frostfs-node
[#1089] control: Add USER and GROUP targets for local override storage
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
0094186299
commit
3ea1d7b729
5 changed files with 18 additions and 0 deletions
|
@ -19,6 +19,10 @@ func apeTarget(chainTarget *control.ChainTarget) (engine.Target, error) {
|
||||||
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
|
return engine.NamespaceTarget(chainTarget.GetName()), nil
|
||||||
|
case control.ChainTarget_USER:
|
||||||
|
return engine.UserTarget(chainTarget.GetName()), nil
|
||||||
|
case control.ChainTarget_GROUP:
|
||||||
|
return engine.GroupTarget(chainTarget.GetName()), nil
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
return engine.Target{}, status.Error(codes.InvalidArgument,
|
return engine.Target{}, status.Error(codes.InvalidArgument,
|
||||||
|
@ -42,6 +46,16 @@ func controlTarget(chainTarget *engine.Target) (control.ChainTarget, error) {
|
||||||
Name: nm,
|
Name: nm,
|
||||||
Type: control.ChainTarget_NAMESPACE,
|
Type: control.ChainTarget_NAMESPACE,
|
||||||
}, nil
|
}, nil
|
||||||
|
case engine.User:
|
||||||
|
return control.ChainTarget{
|
||||||
|
Name: chainTarget.Name,
|
||||||
|
Type: control.ChainTarget_USER,
|
||||||
|
}, nil
|
||||||
|
case engine.Group:
|
||||||
|
return control.ChainTarget{
|
||||||
|
Name: chainTarget.Name,
|
||||||
|
Type: control.ChainTarget_GROUP,
|
||||||
|
}, nil
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
return control.ChainTarget{}, status.Error(codes.InvalidArgument,
|
return control.ChainTarget{}, status.Error(codes.InvalidArgument,
|
||||||
|
|
BIN
pkg/services/control/service.pb.go
generated
BIN
pkg/services/control/service.pb.go
generated
Binary file not shown.
BIN
pkg/services/control/service_grpc.pb.go
generated
BIN
pkg/services/control/service_grpc.pb.go
generated
Binary file not shown.
BIN
pkg/services/control/types.pb.go
generated
BIN
pkg/services/control/types.pb.go
generated
Binary file not shown.
|
@ -179,6 +179,10 @@ message ChainTarget {
|
||||||
NAMESPACE = 1;
|
NAMESPACE = 1;
|
||||||
|
|
||||||
CONTAINER = 2;
|
CONTAINER = 2;
|
||||||
|
|
||||||
|
USER = 3;
|
||||||
|
|
||||||
|
GROUP = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetType type = 1;
|
TargetType type = 1;
|
||||||
|
|
Loading…
Reference in a new issue