Skip to content

Commit

Permalink
prepare engine for node if calling info is needed (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyang0 committed Mar 7, 2024
1 parent c8b84e2 commit ab0c418
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cluster/calcium/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ func (c *Calcium) RemoveNode(ctx context.Context, nodename string) error {
func (c *Calcium) ListPodNodes(ctx context.Context, opts *types.ListNodesOptions) (<-chan *types.Node, error) {
logger := log.WithFunc("calcium.ListPodNodes").WithField("podname", opts.Podname).WithField("labels", opts.Labels).WithField("all", opts.All).WithField("info", opts.CallInfo)
nf := &types.NodeFilter{Podname: opts.Podname, Labels: opts.Labels, All: opts.All}
nodes, err := c.store.GetNodesByPod(ctx, nf, store.WithoutEngineOption())
var (
nodes []*types.Node
err error
)
if opts.CallInfo {
nodes, err = c.store.GetNodesByPod(ctx, nf)
} else {
nodes, err = c.store.GetNodesByPod(ctx, nf, store.WithoutEngineOption())
}
if err != nil {
logger.Error(ctx, err)
return nil, err
Expand Down

0 comments on commit ab0c418

Please sign in to comment.