Skip to content

Commit

Permalink
Merge pull request #129 from kubecost/mmd/fix-tui-query-bug
Browse files Browse the repository at this point in the history
Fix TUI allocation query always reporting empty
  • Loading branch information
michaelmdresser authored Aug 17, 2022
2 parents dc741c5 + 1e623b7 commit d03e39f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cmd/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func runTUI(ko *KubeOptions, do displayOptions, qo query.QueryBackendOptions) er
queryContext, queryCancel = context.WithCancel(context.Background())

// TODO: use flags for service name
allocs, err := query.QueryAllocation(query.AllocationParameters{
queriedAllocs, err := query.QueryAllocation(query.AllocationParameters{
RestConfig: ko.restConfig,
Ctx: queryContext,
QueryParams: map[string]string{
Expand All @@ -247,10 +247,10 @@ func runTUI(ko *KubeOptions, do displayOptions, qo query.QueryBackendOptions) er
// recent window request from the user
} else if err != nil {
log.Errorf("failed to query agg cost model: %s", err)
} else if len(allocations) == 0 {
} else if len(queriedAllocs) == 0 {
log.Errorf("Allocation response was empty. Not updating the table.")
} else {
allocations = allocs[0]
allocations = queriedAllocs[0]

lastUpdated = time.Now()
app.QueueUpdateDraw(func() {
Expand Down

0 comments on commit d03e39f

Please sign in to comment.