[#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:
Evgenii Stratonikov 2024-04-11 17:06:09 +03:00
parent f8973f9b05
commit 498f9955ea
5 changed files with 18 additions and 0 deletions

View file

@ -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,

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -179,6 +179,10 @@ message ChainTarget {
NAMESPACE = 1; NAMESPACE = 1;
CONTAINER = 2; CONTAINER = 2;
USER = 3;
GROUP = 4;
} }
TargetType type = 1; TargetType type = 1;