forked from TrueCloudLab/frostfs-node
[#1329] tree: Sync trees when a node first time appears in a container
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
217b030d20
commit
e1be0180f6
6 changed files with 181 additions and 52 deletions
|
@ -29,6 +29,22 @@ type dummyNetmapSource struct {
|
|||
|
||||
type dummyContainerSource map[string]*containercore.Container
|
||||
|
||||
func (s dummyContainerSource) List() ([]cid.ID, error) {
|
||||
res := make([]cid.ID, 0, len(s))
|
||||
var cnr cid.ID
|
||||
|
||||
for cidStr := range s {
|
||||
err := cnr.DecodeString(cidStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res = append(res, cnr)
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (s dummyContainerSource) Get(id cid.ID) (*containercore.Container, error) {
|
||||
cnt, ok := s[id.String()]
|
||||
if !ok {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue