[#910] control: Take empty namespace for 'root'
Some checks failed
DCO action / DCO (pull_request) Successful in 2m45s
Vulncheck / Vulncheck (pull_request) Successful in 3m4s
Build / Build Components (1.21) (pull_request) Successful in 3m38s
Build / Build Components (1.20) (pull_request) Successful in 3m47s
Tests and linters / Staticcheck (pull_request) Successful in 3m59s
Tests and linters / Tests (1.20) (pull_request) Successful in 4m20s
Tests and linters / Tests (1.21) (pull_request) Successful in 4m30s
Tests and linters / Tests with -race (pull_request) Failing after 4m37s
Tests and linters / Lint (pull_request) Successful in 4m54s
Some checks failed
DCO action / DCO (pull_request) Successful in 2m45s
Vulncheck / Vulncheck (pull_request) Successful in 3m4s
Build / Build Components (1.21) (pull_request) Successful in 3m38s
Build / Build Components (1.20) (pull_request) Successful in 3m47s
Tests and linters / Staticcheck (pull_request) Successful in 3m59s
Tests and linters / Tests (1.20) (pull_request) Successful in 4m20s
Tests and linters / Tests (1.21) (pull_request) Successful in 4m30s
Tests and linters / Tests with -race (pull_request) Failing after 4m37s
Tests and linters / Lint (pull_request) Successful in 4m54s
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
52ffa9f164
commit
1bbfe186ae
1 changed files with 6 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue