Skip to content

Commit

Permalink
fix: reassign err to prevent invalid return in KedaProvider `GetExter…
Browse files Browse the repository at this point in the history
…nalMetric` (#6010)

Signed-off-by: Max Cao <macao@redhat.com>
  • Loading branch information
maxcao13 authored Jul 31, 2024
1 parent 352665f commit d2f94b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Here is an overview of all new **experimental** features:
### Fixes

- **General**: Check for missing CRD references and sample CRs ([#5920](https://github.com/kedacore/keda/issues/5920))
- **General**: Fix panic in `KedaProvider` when getting metrics from Metrics Service if the gRPC Server connection is not established ([#6009](https://github.com/kedacore/keda/issues/6009))
- **General**: Scalers are properly closed after being refreshed ([#5806](https://github.com/kedacore/keda/issues/5806))
- **New Relic Scaler**: Fix CVE-2024-6104 in github.com/hashicorp/go-retryablehttp ([#5944](https://github.com/kedacore/keda/issues/5944))

Expand Down
3 changes: 2 additions & 1 deletion pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func (p *KedaProvider) GetExternalMetric(ctx context.Context, namespace string,
// Get Metrics from Metrics Service gRPC Server
if !p.grpcClient.WaitForConnectionReady(ctx, logger) {
grpcClientConnected = false
logger.Error(fmt.Errorf("timeout while waiting to establish gRPC connection to KEDA Metrics Service server"), "timeout", "server", p.grpcClient.GetServerURL())
err := fmt.Errorf("timeout while waiting to establish gRPC connection to KEDA Metrics Service server")
logger.Error(err, "timeout", "server", p.grpcClient.GetServerURL())
return nil, err
}
if !grpcClientConnected {
Expand Down

0 comments on commit d2f94b8

Please sign in to comment.