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` (kedacore#6010)

Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
maxcao13 authored and JorTurFer committed Oct 7, 2024
1 parent 4be2900 commit d4eb917
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 d4eb917

Please sign in to comment.