[#xx] cli: Add policy-playground command #416
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#416
Loading…
Reference in a new issue
No description provided.
Delete branch "ale64bit/frostfs-node:feature/policy-playground"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Not sure if we actually want this, but just in case.
A very simple playground to experiment with placement policies and dry run their effect before actually creating containers.
It can be used as a standalone tool without any deployment:
or pulling the initial netmap data from an existing deployment (e.g. dev-env):
Related to #227
Signed-off-by: Alejandro Lopez a.lopez@yadro.com
@ -0,0 +131,4 @@
}
cmdHandlers := map[string]func([]string) error{
"ls": repl.handleLs,
Probably, someone won't find the necessity of this, but I suggest you to consider
Cobra
approach to create subcommands forls
,add
,remove
,eval
I believe your implementation works finely but for me: this isn't my approach to process args within the handlers :)
Cobra
can handle betterI don't mind using
cobra
or evenflag
for it, although it feels a bit of an overkill. The idea was to circulate the feature first, in the simplest implementation I came up with. In case it's something we want to add, I can polish it a bit, including better command handling if needed. If it's not something we want, I'll keep it to myself without any fancy command handling.OK
@ -0,0 +114,4 @@
}
func (repl *policyPlaygroundREPL) run() error {
if len(viper.GetString(commonflags.WalletPath)) > 0 {
Can we use
key.GetOrGenerate
and branch based on the--rpc-endpoint
? https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/cmd/frostfs-cli/internal/key/raw.go#L47Netmap snapshot does not need any specific key.
done 👍
024a93b1f4
to2fdde0861d