From 51352d818c390e4de18b6d266dec47d4504a8a72 Mon Sep 17 00:00:00 2001 From: khaikong Date: Thu, 29 Jan 2026 02:51:49 +0000 Subject: [PATCH 1/2] Add part to convert sentinel_nodes values --- convert/plugin_updates.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/convert/plugin_updates.go b/convert/plugin_updates.go index 7c3744970..d900532a4 100644 --- a/convert/plugin_updates.go +++ b/convert/plugin_updates.go @@ -2,6 +2,7 @@ package convert import ( "fmt" + "strconv" "strings" "github.com/kong/go-database-reconciler/pkg/cprint" @@ -188,6 +189,25 @@ func updateLegacyFieldToNewField(pluginConfig kong.Configuration, return pluginConfig } + if newField == "redis.sentinel_nodes" { + rawList, _ := value.([]interface{}) + var newIpPort []map[string]interface{} + for _, item := range rawList { + if entry, ok := item.(string); ok { + parts := strings.Split(entry, ":") + if len(parts) == 2 { + // 3. Convert the port string to an integer + portInt, _ := strconv.Atoi(parts[1]) + newIpPort = append(newIpPort, map[string]interface{}{ + "host": parts[0], + "port": portInt, + }) + } + } + } + value = newIpPort + } + // Remove the old field delete(current, oldKey) @@ -257,3 +277,8 @@ func convertScalarToList(pluginConfig kong.Configuration, return pluginConfig } + +func convertIpToIpPort(pluginConfig kong.Configuration, fieldName, pluginName string) kong.Configuration { + + return pluginConfig +} From 7c89312eaa55349a8b24e1b9af47564f0dc33168 Mon Sep 17 00:00:00 2001 From: khaikong Date: Thu, 29 Jan 2026 02:56:51 +0000 Subject: [PATCH 2/2] remove unecessary item --- convert/plugin_updates.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/convert/plugin_updates.go b/convert/plugin_updates.go index d900532a4..401729fe7 100644 --- a/convert/plugin_updates.go +++ b/convert/plugin_updates.go @@ -277,8 +277,3 @@ func convertScalarToList(pluginConfig kong.Configuration, return pluginConfig } - -func convertIpToIpPort(pluginConfig kong.Configuration, fieldName, pluginName string) kong.Configuration { - - return pluginConfig -}