You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI: opencloud decomposedfs metadata dump|get|set reject --root and --node #4083
Giving the flags before the subcommand (metadata --root … --node … dump) fails the same way.
--root and --node are defined with Flags() on the metadata command (opencloud/pkg/command/decomposedfs.go:186-188), and cobra doesn't pass those on to the subcommands dump, get and set, which read them. check-treesize isn't affected, as it defines its own flags.
Fix: define both flags with PersistentFlags(), so that the subcommands inherit them, and add a test that runs a subcommand with them.
Some background for the issue: the commands broke with the migration from urfave/cli to cobra in 56324ca (December 2025).
Before, --root and --node were flags of metadata, and dump, get and set read them with c.String("root"), which in urfave/cli also looks at the flags of the parent commands. So opencloud decomposedfs metadata --root … --node … dump worked.
The migration turned them into metaCmd.Flags(). In cobra, those belong to metadata alone, so the subcommands don't know them. PersistentFlags() is cobra's counterpart of the old behaviour.
35b3e51 ("fix opencloud decomposedfs flags") fixed the flags of check-treesize afterwards, but not those of metadata.
The commands have no tests, which is probably why it went unnoticed. A test that runs metadata dump with --root and --node would catch it next time.
Note: these commands are for decomposed storage (e.g. the system storage); they don't support posix, the default for user files.
Activity
asaah262 commentedon Nov 20, 2026
Some background for the issue: the commands broke with the migration from urfave/cli to cobra in 56324ca (December 2025).
--rootand--nodewere flags ofmetadata, anddump,getandsetread them withc.String("root"), which in urfave/cli also looks at the flags of the parent commands. Soopencloud decomposedfs metadata --root … --node … dumpworked.metaCmd.Flags(). In cobra, those belong tometadataalone, so the subcommands don't know them.PersistentFlags()is cobra's counterpart of the old behaviour.check-treesizeafterwards, but not those ofmetadata.The commands have no tests, which is probably why it went unnoticed. A test that runs
metadata dumpwith--rootand--nodewould catch it next time.Note: these commands are for decomposed storage (e.g. the system storage); they don't support
posix, the default for user files.