Browse Source

Merge branch 'develop' into tevans/occc

Signed-off-by: Thomas Evans <teevans@users.noreply.github.com>
Thomas Evans 2 years ago
parent
commit
0321ea54d8
1 changed files with 6 additions and 2 deletions
  1. 6 2
      pkg/cloud/gcp/bigqueryquerier.go

+ 6 - 2
pkg/cloud/gcp/bigqueryquerier.go

@@ -2,6 +2,7 @@ package gcp
 
 import (
 	"context"
+	"fmt"
 
 	"cloud.google.com/go/bigquery"
 	"github.com/opencost/opencost/pkg/cloud"
@@ -49,9 +50,12 @@ func (bqq *BigQueryQuerier) Query(ctx context.Context, queryStr string) (*bigque
 	// If result is empty and connection status is not already successful update status to missing data
 	if iter == nil && bqq.ConnectionStatus != cloud.SuccessfulConnection {
 		bqq.ConnectionStatus = cloud.MissingData
-		return iter, nil
+	} else {
+		bqq.ConnectionStatus = cloud.SuccessfulConnection
 	}
 
-	bqq.ConnectionStatus = cloud.SuccessfulConnection
+	if err != nil {
+		return iter, fmt.Errorf("BigQueryQuerier: Query: error reading query results: %w", err)
+	}
 	return iter, nil
 }