From 305732d98747887cc6311f45c135d958fa91eac2 Mon Sep 17 00:00:00 2001 From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com> Date: Wed, 16 Sep 2026 17:26:03 +0200 Subject: [PATCH] Removed LUA scripting from the Redis sample, because since .NET 9, Redis connectivity no longer needs it --- .../src/Redis/Controllers/HomeController.cs | 16 ---------------- Connectors/src/Redis/Models/RedisViewModel.cs | 1 - Connectors/src/Redis/Views/Home/Index.cshtml | 11 +---------- Connectors/src/Redis/testing/linux.feature | 3 +-- Connectors/src/Redis/testing/windows.feature | 3 +-- 5 files changed, 3 insertions(+), 31 deletions(-) diff --git a/Connectors/src/Redis/Controllers/HomeController.cs b/Connectors/src/Redis/Controllers/HomeController.cs index 2634c6d4a..08682effb 100644 --- a/Connectors/src/Redis/Controllers/HomeController.cs +++ b/Connectors/src/Redis/Controllers/HomeController.cs @@ -27,7 +27,6 @@ public async Task Index(CancellationToken cancellationToken) var model = new RedisViewModel { ConnectionString = _connectionMultiplexerConnector.Options.ConnectionString, - LuaResult = EvaluateLuaScript(database) }; foreach (string keyName in keyNames.OrderBy(name => name)) @@ -75,21 +74,6 @@ private static async Task> GetKeyNamesAsync(IConnectionMultiplexer return value.ToString(); } - private static string EvaluateLuaScript(IDatabase database) - { - try - { - LuaScript script = LuaScript.Prepare("local val=\"Hello from Lua\" return val"); - RedisResult result = database.ScriptEvaluate(script); - - return result.ToString(); - } - catch - { - return "Failed to execute Lua script, scripting is likely not enabled."; - } - } - public IActionResult Privacy() { return View(); diff --git a/Connectors/src/Redis/Models/RedisViewModel.cs b/Connectors/src/Redis/Models/RedisViewModel.cs index fa1fcbcc6..452cf021b 100644 --- a/Connectors/src/Redis/Models/RedisViewModel.cs +++ b/Connectors/src/Redis/Models/RedisViewModel.cs @@ -6,5 +6,4 @@ public sealed class RedisViewModel public IDictionary DistributedCacheData { get; set; } = new Dictionary(); public IDictionary ConnectionMultiplexerData { get; set; } = new Dictionary(); - public string? LuaResult { get; set; } } diff --git a/Connectors/src/Redis/Views/Home/Index.cshtml b/Connectors/src/Redis/Views/Home/Index.cshtml index 8156c4d3d..7e6340860 100644 --- a/Connectors/src/Redis/Views/Home/Index.cshtml +++ b/Connectors/src/Redis/Views/Home/Index.cshtml @@ -1,4 +1,4 @@ -@model Steeltoe.Samples.Redis.Models.RedisViewModel +@model Steeltoe.Samples.Redis.Models.RedisViewModel @{ ViewData["Title"] = "Home Page"; } @@ -63,13 +63,4 @@ } - -

Lua result

- - - - - - -
@Model.LuaResult
diff --git a/Connectors/src/Redis/testing/linux.feature b/Connectors/src/Redis/testing/linux.feature index 61a60e402..637e2bb85 100644 --- a/Connectors/src/Redis/testing/linux.feature +++ b/Connectors/src/Redis/testing/linux.feature @@ -9,8 +9,7 @@ Feature: Connectors When you push: manifest.yml And you wait until CloudFoundry app redis-connector-sample is started When you get https://redis-connector-sample/ - Then you should see "Hello from Lua" - And you should see "redis-connector-sampleKeySetUsingMicrosoftApi1" + Then you should see "redis-connector-sampleKeySetUsingMicrosoftApi1" And you should see "ValueSetUsingMicrosoftApi1" And you should see "redis-connector-sampleKeySetUsingMicrosoftApi2" And you should see "ValueSetUsingMicrosoftApi2" diff --git a/Connectors/src/Redis/testing/windows.feature b/Connectors/src/Redis/testing/windows.feature index dff26c3f6..ed79858ff 100644 --- a/Connectors/src/Redis/testing/windows.feature +++ b/Connectors/src/Redis/testing/windows.feature @@ -10,8 +10,7 @@ Feature: Connectors And you push: manifest-windows.yml with args: -p bin/Release/net10.0/win-x64/publish And you wait until CloudFoundry app redis-connector-sample is started When you get https://redis-connector-sample/ - Then you should see "Hello from Lua" - And you should see "redis-connector-sampleKeySetUsingMicrosoftApi1" + Then you should see "redis-connector-sampleKeySetUsingMicrosoftApi1" And you should see "ValueSetUsingMicrosoftApi1" And you should see "redis-connector-sampleKeySetUsingMicrosoftApi2" And you should see "ValueSetUsingMicrosoftApi2"