diff --git a/istio/1.12/patches/istio/20240202-fix-rds-cache.patch b/istio/1.12/patches/istio/20240202-fix-rds-cache.patch new file mode 100644 index 000000000..73d9a443a --- /dev/null +++ b/istio/1.12/patches/istio/20240202-fix-rds-cache.patch @@ -0,0 +1,41 @@ +diff -Naur istio/pilot/pkg/xds/discovery.go istio-new/pilot/pkg/xds/discovery.go +--- istio/pilot/pkg/xds/discovery.go 2024-02-02 16:26:49.000000000 +0800 ++++ istio-new/pilot/pkg/xds/discovery.go 2024-02-02 15:38:53.000000000 +0800 +@@ -18,6 +18,7 @@ + "context" + "fmt" + "strconv" ++ "strings" + "sync" + "time" + +@@ -41,6 +42,7 @@ + "istio.io/istio/pilot/pkg/util/sets" + v3 "istio.io/istio/pilot/pkg/xds/v3" + "istio.io/istio/pkg/cluster" ++ "istio.io/istio/pkg/config/constants" + "istio.io/istio/pkg/security" + ) + +@@ -332,6 +334,21 @@ + } else { + // Otherwise, just clear the updated configs + s.Cache.Clear(req.ConfigsUpdated) ++ //Added by ingress ++ trimKeyMap := make(map[model.ConfigKey]struct{}) ++ for configKey := range req.ConfigsUpdated { ++ if strings.HasPrefix(configKey.Name, constants.IstioIngressGatewayName+"-") { ++ trimKeyMap[model.ConfigKey{ ++ Kind: configKey.Kind, ++ Name: strings.TrimPrefix(configKey.Name, constants.IstioIngressGatewayName+"-"), ++ Namespace: configKey.Namespace, ++ }] = struct{}{} ++ } ++ } ++ if len(trimKeyMap) > 0 { ++ s.Cache.Clear(trimKeyMap) ++ } ++ //End added by ingress + } + } +