[#521] Add netmap load command to policy playground #522
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#522
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "ale64bit/frostfs-node:fix/521-pp-load"
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?
Adds a
load
command to load an external netmap from a json file:The structure is trivial:
For example:
This makes it easy to load custom netmaps and modify the existing one and adds support for attribute names containing space. Note that the
load
command discards any existing netmap info.Signed-off-by: Alejandro Lopez a.lopez@yadro.com
Closes #521
@ -51,6 +52,7 @@ func (repl *policyPlaygroundREPL) handleAdd(args []string) error {
if len(args) == 0 {
return fmt.Errorf("too few arguments for command 'add': got %d, want >0", len(args))
}
unrelated to the commit
done
@ -72,0 +83,4 @@
return fmt.Errorf("reading netmap file %q: %v", args[0], err)
}
if err := json.Unmarshal(b, &jsonNetmap); err != nil {
Why did you decide to stay on JSON? I mean it is good, but what about supporting YAML too?
mmm, I guess I didn't think too much of it. JSON was simple enough for this particular use-case.
Maybe let's think about supporting YAML later, if someone actually asks for it.
@ -132,7 +168,10 @@ func (repl *policyPlaygroundREPL) run() error {
cmdHandlers := map[string]func([]string) error{
"ls": repl.handleLs,
"list": repl.handleLs,
Again, seems unrelated to the commit, could you move it to a separate commit?
done
89bd54a339
toef0bf5029c
ef0bf5029c
to79fae06d31