From 02d191e9a6a1c347ae95f81ba6b9e125dde9efef Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 29 Jul 2024 15:33:36 +0300 Subject: [PATCH] [#1279] adm: Interpret "root" name as empty for namespace target type Signed-off-by: Airat Arifullin --- cmd/frostfs-adm/internal/modules/morph/ape/ape_util.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/frostfs-adm/internal/modules/morph/ape/ape_util.go b/cmd/frostfs-adm/internal/modules/morph/ape/ape_util.go index 5e17f4014..d4aedda2e 100644 --- a/cmd/frostfs-adm/internal/modules/morph/ape/ape_util.go +++ b/cmd/frostfs-adm/internal/modules/morph/ape/ape_util.go @@ -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{ -- 2.45.2