Skip to content

Commit

Permalink
chore: update data explorer scaler to fix deprecation (#2991)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Turrado Ferrero authored May 3, 2022
1 parent 92fe72f commit ea3b2e1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ issues:
- path: azure/azure_app_insights.go
linters:
- bodyclose
# remove once https://github.com/kedacore/keda/issues/2989 is fixed
- path: azure/azure_data_explorer.go
linters:
- staticcheck

linters-settings:
funlen:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md
- **AWS Kinesis Stream:** Adding e2e test ([#1526](https://github.com/kedacore/keda/issues/1526))
- **AWS SQS Queue:** Adding e2e test ([#1527](https://github.com/kedacore/keda/issues/1527))
- **Azure Data Explorer:** Adding e2e test ([#2841](https://github.com/kedacore/keda/issues/2841))
- **Azure Data Explorer:** Replace deprecated function `iter.Next()` in favour of `iter.NextRowOrError()` ([#2989](https://github.com/kedacore/keda/issues/2989))
- **Azure Service Bus:** Adding e2e test ([#2731](https://github.com/kedacore/keda/issues/2731)|[#2732](https://github.com/kedacore/keda/issues/2732))
- **External Scaler:** Adding e2e test. ([#2697](https://github.com/kedacore/keda/issues/2697))
- **External Scaler:** Fix issue with internal KEDA core prefix being passed to external scaler. ([#2640](https://github.com/kedacore/keda/issues/2640))
Expand Down
2 changes: 1 addition & 1 deletion pkg/mock/mock_client/mock_interfaces.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/mock/mock_scale/mock_interfaces.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pkg/scalers/azure/azure_data_explorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ func GetAzureDataExplorerMetricValue(ctx context.Context, client *kusto.Client,
}
defer iter.Stop()

row, err := iter.Next()
row, inlineError, err := iter.NextRowOrError()
if inlineError != nil {
return -1, fmt.Errorf("failed to get query %s result: %v", query, inlineError)
}
if err != nil {
return -1, fmt.Errorf("failed to get query %s result: %v", query, err)
}
Expand All @@ -102,7 +105,7 @@ func GetAzureDataExplorerMetricValue(ctx context.Context, client *kusto.Client,
}

// Return error if there is more than one row.
_, err = iter.Next()
_, _, err = iter.NextRowOrError()
if err != io.EOF {
return -1, fmt.Errorf("query %s result had more than a single result row", query)
}
Expand Down

0 comments on commit ea3b2e1

Please sign in to comment.