Fix Temporal Scaler TLS RootCAs initialization for API Key authentication#7367
Conversation
|
Thank you for your contribution! 🙏 Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected. While you are waiting, make sure to:
Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient. Learn more about our contribution guide. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
/run-e2e temporal |
|
/run-e2e temporal |
|
on a surface this looks good but the e2e tests are now failing, I was able to trace it to this message full error log line: |
There was a problem hiding this comment.
Pull request overview
This PR fixes a TLS certificate verification issue in the Temporal scaler when using API key authentication to connect to Temporal Cloud. The fix ensures that the TLS configuration properly initializes the RootCAs certificate pool by using the existing utility function instead of manually creating a minimal TLS config.
Key Changes:
- Replaced manual TLS config creation with
kedautil.CreateTLSClientConfig()for API key authentication path - This ensures RootCAs are properly initialized with system certificates and custom CA certificates from
/custom/caif present
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/scalers/temporal_scaler.go | Fixed TLS RootCAs initialization when using API key authentication by replacing manual config creation with the utility function |
| CHANGELOG.md | Added entry documenting the bug fix for Temporal scaler TLS configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@wozniakjan I see the failed e2e tests, but I don't think the changes in the PR cause the e2e failure because in the previous PR , this e2e tests never pass https://github.com/kedacore/keda/commits/main/pkg/scalers/temporal_scaler.go However, looking at the log, I think there might be a race condition where the ScaleObject was applied first before the Deployment though. Let me try to decouple the kubectl apply |
|
/run-e2e temporal |
|
/run-e2e temporal |
|
I think that temporal test is failing because of temporalio/omes#280 |
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
a56694e to
92c81b2
Compare
|
/run-e2e temporal |
…tion (kedacore#7367) * Fix how tls config is initialised for temporal scaler Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg> * Add changelog Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg> * Attempt to fix failing e2e test Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg> * Fix CI lint error Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg> --------- Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>

Problem
When using the Temporal scaler with API key authentication to connect to Temporal Cloud, users encounter the following error:
Root Cause
In
getTemporalClient(), when API key authentication is used, the code creates a minimal TLS configuration with onlyMinVersionset:The
RootCAsfield is left asnil. While Go's TLS library should use system certificates whenRootCAsisnil, in practice this can fail in certain environments (e.g., containers where system cert pool may not be available) or when the TLS config is passed through gRPC's credential layer. Additionally, explicitly initializingRootCAsensures consistent behavior across all environments and allows for custom CA certificates to be loaded from/custom/caif needed.Solution
Replace the manual TLS config creation with
kedautil.CreateTLSClientConfig(), which properly initializesRootCAsviagetRootCAs(). This function:x509.SystemCertPool()/custom/cadirectory if presentChecklist
make generate-scalers-schemahas been run to update any outdated generated files.Fixes #7343