Skip to content

Commit

Permalink
fix Eru "Pod Resource" function returned duplicated projecteru2#544
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiaosen Chen committed Jan 26, 2022
1 parent 4f4d5cf commit 622d258
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 622d258

Please sign in to comment.