From 3f95719cade105f5ed8f8745761ebdd1b1a7b7d9 Mon Sep 17 00:00:00 2001 From: Sasidharan Gopal Date: Mon, 4 Nov 2024 17:53:18 +0530 Subject: [PATCH] DR-2672 - Dummy stub for client setinfo --- .../filters/network/common/redis/supported_commands.h | 2 +- .../filters/network/redis_proxy/command_splitter_impl.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/extensions/filters/network/common/redis/supported_commands.h b/source/extensions/filters/network/common/redis/supported_commands.h index 478c476eeb9b..f6e24065f106 100644 --- a/source/extensions/filters/network/common/redis/supported_commands.h +++ b/source/extensions/filters/network/common/redis/supported_commands.h @@ -113,7 +113,7 @@ struct SupportedCommands { * @return client sub commands thats supported */ static const absl::flat_hash_set& clientSubCommands() { - CONSTRUCT_ON_FIRST_USE(absl::flat_hash_set, "getname","setname"); + CONSTRUCT_ON_FIRST_USE(absl::flat_hash_set, "getname","setname", "setinfo"); } /** diff --git a/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc b/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc index 3fe578139211..3ee9d617daea 100644 --- a/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc +++ b/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc @@ -2007,6 +2007,9 @@ SplitRequestPtr InstanceImpl::makeRequest(Common::Redis::RespValuePtr&& request, ClientResp->type(Common::Redis::RespType::BulkString); ClientResp->asString() = callbacks.getClientname(); } + }else if (sub_command == "setinfo") { + ClientResp->type(Common::Redis::RespType::SimpleString); + ClientResp->asString() = "OK"; } callbacks.onResponse(std::move(ClientResp)); return nullptr;