fix(redis scaler): use literal command names in Lua script for Alibaba Cloud compatibility#7759
Conversation
…a Cloud compatibility The Redis scaler's Lua script uses a table lookup variable as the first argument to redis.call(), which fails on Alibaba Cloud Redis Cluster instances that enforce strict Lua script validation. Replace the table lookup pattern with if/elseif branches so every redis.call() has a literal string as the first argument, compatible with both standard Redis and Alibaba Cloud Redis Cluster. Fixes kedacore#7758 Signed-off-by: cxhello <caixiaohuichn@gmail.com>
|
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. |
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
|
/run-e2e redis passed tests: 0failed tests: 12 |
There was a problem hiding this comment.
Pull request overview
This PR updates the Redis scaler’s Lua script to avoid passing a variable/table lookup as the first argument to redis.call, improving compatibility with Alibaba Cloud Redis Cluster’s strict Lua script validation.
Changes:
- Replace Lua table-based command selection (
cmd[listType]) withif/elseifbranches that call Redis commands via literal strings. - Add an Unreleased changelog entry documenting the Redis scaler compatibility fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
pkg/scalers/redis_scaler.go |
Updates the Redis scaler Lua script to use literal command names in redis.call. |
CHANGELOG.md |
Adds an Unreleased “Redis Scaler” fix entry (but also removes an unrelated AWS scalers entry). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@wozniakjan: I don't think this one will succeed; I believe we have some Redis E2E issues (given that all Redis tests fail in both main and E2E). |
I also suspected that, haven't investigated but thought that maybe randomly this PR fixes it :). If it fails here too then I will troubleshoot the redis e2e tests in main. EDIT: #7768 |
… entry - Add explicit handling for 'list' and 'none' key types in Lua script - Return error_reply for unsupported key types (e.g. string, stream) - Restore accidentally removed AWS Scalers changelog entry Signed-off-by: cxhello <caixiaohuichn@gmail.com>
…order Signed-off-by: cxhello <caixiaohuichn@gmail.com>
|
Thanks for the review! Addressed all feedback in the latest push:
|
|
/run-e2e redis |
|
/run-e2e redis |
|
/run-e2e redis passed tests: 12failed tests: 0 |
The Redis scaler's Lua script uses a table lookup variable as the first argument to
redis.call(), which fails on Alibaba Cloud Redis Cluster instances that enforce strict Lua script validation requiring literal strings.Before (fails on Alibaba Cloud Redis Cluster):
After (compatible with all Redis deployments):
Checklist
Fixes #7758