Skip to content

Commit

Permalink
fix rds cache (#815)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlanni committed Feb 2, 2024
1 parent 29c95ea commit e43f5d1
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions istio/1.12/patches/istio/20240202-fix-rds-cache.patch
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit e43f5d1

Please sign in to comment.