[#271] service/audit: Add netmap structure to audit task
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
64b022a5ed
commit
dd5e67ff0c
2 changed files with 18 additions and 1 deletions
|
@ -90,7 +90,8 @@ func (ap *Processor) processStartAudit(epoch uint64) {
|
|||
WithContainerID(containers[i]).
|
||||
WithStorageGroupList(storageGroups).
|
||||
WithContainerStructure(cnr).
|
||||
WithContainerNodes(nodes)
|
||||
WithContainerNodes(nodes).
|
||||
WithNetworkMap(nm)
|
||||
|
||||
if err := ap.taskManager.PushTask(auditTask); err != nil {
|
||||
ap.log.Error("could not push audit task",
|
||||
|
|
|
@ -18,6 +18,8 @@ type Task struct {
|
|||
|
||||
cnr *container.Container
|
||||
|
||||
nm *netmap.Netmap
|
||||
|
||||
cnrNodes netmap.ContainerNodes
|
||||
|
||||
sgList []*object.ID
|
||||
|
@ -88,6 +90,20 @@ func (t *Task) WithContainerNodes(cnrNodes netmap.ContainerNodes) *Task {
|
|||
return t
|
||||
}
|
||||
|
||||
// NetworkMap returns network map of audit epoch.
|
||||
func (t *Task) NetworkMap() *netmap.Netmap {
|
||||
return t.nm
|
||||
}
|
||||
|
||||
// WithNetworkMap sets network map of audit epoch.
|
||||
func (t *Task) WithNetworkMap(nm *netmap.Netmap) *Task {
|
||||
if t != nil {
|
||||
t.nm = nm
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
// ContainerNodes returns nodes in the container under audit.
|
||||
func (t *Task) ContainerNodes() netmap.ContainerNodes {
|
||||
return t.cnrNodes
|
||||
|
|
Loading…
Reference in a new issue