adm: Interpret "root" name as empty for namespace target type #1287

Merged
dstepanov-yadro merged 1 commit from fyrchik/frostfs-node:adm-root into support/v0.42 2024-08-01 14:39:04 +00:00

View file

@ -38,6 +38,12 @@ var (
func parseTarget(cmd *cobra.Command) policyengine.Target {
name, _ := cmd.Flags().GetString(targetNameFlag)
typ, err := parseTargetType(cmd)
// interpret "root" namespace as empty
if typ == policyengine.Namespace && name == "root" {
name = ""
}
commonCmd.ExitOnErr(cmd, "read target type error: %w", err)
return policyengine.Target{