Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3790 +/- ##
==========================================
- Coverage 25.52% 25.51% -0.02%
==========================================
Files 660 663 +3
Lines 42636 42673 +37
==========================================
+ Hits 10884 10889 +5
- Misses 30749 30783 +34
+ Partials 1003 1001 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9bbeb3f to
7b9ea0b
Compare
2b79a01 to
b430c89
Compare
Add a CLI utility to validate container policies and display nodes that are policy-compliant in the current epoch. Closes #3626. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
| Long: `Check placement policy parsing and validation. | ||
| Policy can be provided as QL-encoded string, JSON-encoded string or path to file with it. | ||
| Shows nodes that will be used for container placement based on current network map snapshot.`, | ||
| Args: cobra.NoArgs, |
There was a problem hiding this comment.
policy can naturally be an arg (not a flag) imo, but do not insist
| return fmt.Errorf("unable to get netmap snapshot to validate container placement: %w", err) | ||
| } | ||
|
|
||
| placementNodes, err := nm.ContainerNodes(*placementPolicy, cid.ID{}) |
There was a problem hiding this comment.
@cthulhu-rider, is it possible to get a different result in some corner cases if we intentionally put cid.ID{} instead of a real container id?
There was a problem hiding this comment.
I guess it's possible if we have a lot of nodes and have to choose some subset of them. Then we should warn that this command result can differ from real container because of that.
| return &result, nil | ||
| } | ||
|
|
||
| return nil, errors.New("can't parse placement policy") |
There was a problem hiding this comment.
with no details at all? can be hard to debug for a user, even in --verbose mode
There was a problem hiding this comment.
oh, that is a copy from another file, ok
Closes #3626.