[#1095] adm: Support user/group target for APE
All checks were successful
DCO action / DCO (pull_request) Successful in 3m32s
Vulncheck / Vulncheck (pull_request) Successful in 3m56s
Build / Build Components (1.22) (pull_request) Successful in 4m31s
Build / Build Components (1.21) (pull_request) Successful in 4m35s
Tests and linters / gopls check (pull_request) Successful in 4m51s
Tests and linters / Staticcheck (pull_request) Successful in 5m2s
Tests and linters / Lint (pull_request) Successful in 6m6s
Tests and linters / Tests (1.21) (pull_request) Successful in 9m6s
Tests and linters / Tests with -race (pull_request) Successful in 9m3s
Tests and linters / Tests (1.22) (pull_request) Successful in 9m13s

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-04-16 13:19:16 +03:00
parent 19277ac906
commit 41093fe36c
2 changed files with 6 additions and 0 deletions

View file

@ -16,6 +16,8 @@ import (
const (
namespaceTarget = "namespace"
containerTarget = "container"
userTarget = "user"
groupTarget = "group"
jsonFlag = "json"
jsonFlagDesc = "Output rule chains in JSON format"
chainIDFlag = "chain-id"

View file

@ -53,6 +53,10 @@ func parseTargetType(cmd *cobra.Command) (policyengine.TargetType, error) {
return policyengine.Namespace, nil
case containerTarget:
return policyengine.Container, nil
case userTarget:
return policyengine.User, nil
case groupTarget:
return policyengine.Group, nil
}
return -1, errUnknownTargetType
}