Skip to content

Commit

Permalink
fix Eru "Pod Resource" function returned duplicated (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
DuodenumL authored Mar 4, 2022
1 parent d145b4c commit 47a4a04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cluster/calcium/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ func (c *Calcium) PodResource(ctx context.Context, podname string) (chan *types.
go func() {
defer close(ch)
for node := range nodeCh {
nodename := node.Name
pool.Go(ctx, func() {
nodeResource, err := c.doGetNodeResource(ctx, node.Name, false)
nodeResource, err := c.doGetNodeResource(ctx, nodename, false)
if err != nil {
nodeResource = &types.NodeResource{
Name: node.Name, Diffs: []string{logger.Err(ctx, err).Error()},
Name: nodename, Diffs: []string{logger.Err(ctx, err).Error()},
}
}
ch <- nodeResource
Expand Down

0 comments on commit 47a4a04

Please sign in to comment.