[#1089] control: Add USER and GROUP targets for local override storage
All checks were successful
DCO action / DCO (pull_request) Successful in 1m35s
Build / Build Components (1.20) (pull_request) Successful in 3m21s
Vulncheck / Vulncheck (pull_request) Successful in 3m2s
Build / Build Components (1.21) (pull_request) Successful in 3m52s
Tests and linters / Staticcheck (pull_request) Successful in 4m21s
Tests and linters / Lint (pull_request) Successful in 5m38s
Tests and linters / gopls check (pull_request) Successful in 5m48s
Tests and linters / Tests (1.20) (pull_request) Successful in 7m34s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m1s
Tests and linters / Tests with -race (pull_request) Successful in 8m27s
All checks were successful
DCO action / DCO (pull_request) Successful in 1m35s
Build / Build Components (1.20) (pull_request) Successful in 3m21s
Vulncheck / Vulncheck (pull_request) Successful in 3m2s
Build / Build Components (1.21) (pull_request) Successful in 3m52s
Tests and linters / Staticcheck (pull_request) Successful in 4m21s
Tests and linters / Lint (pull_request) Successful in 5m38s
Tests and linters / gopls check (pull_request) Successful in 5m48s
Tests and linters / Tests (1.20) (pull_request) Successful in 7m34s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m1s
Tests and linters / Tests with -race (pull_request) Successful in 8m27s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
f8973f9b05
commit
498f9955ea
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
|
||||
case control.ChainTarget_NAMESPACE:
|
||||
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:
|
||||
}
|
||||
return engine.Target{}, status.Error(codes.InvalidArgument,
|
||||
|
@ -42,6 +46,16 @@ func controlTarget(chainTarget *engine.Target) (control.ChainTarget, error) {
|
|||
Name: nm,
|
||||
Type: control.ChainTarget_NAMESPACE,
|
||||
}, 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:
|
||||
}
|
||||
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;
|
||||
|
||||
CONTAINER = 2;
|
||||
|
||||
USER = 3;
|
||||
|
||||
GROUP = 4;
|
||||
}
|
||||
|
||||
TargetType type = 1;
|
||||
|
|
Loading…
Reference in a new issue