File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -92,24 +92,31 @@ func cdsNeedsPush(req *model.PushRequest, proxy *model.Proxy) bool {
92
92
return true
93
93
}
94
94
95
- autoPassthroughModeChanged := proxy .MergedGateway .HasAutoPassthroughGateways () != proxy .PrevMergedGateway .HasAutoPassthroughGateway ()
96
- autoPassthroughHostsChanged := ! proxy .MergedGateway .GetAutoPassthrughGatewaySNIHosts ().Equals (proxy .PrevMergedGateway .GetAutoPassthroughSNIHosts ())
95
+ checkGateway := false
97
96
for config := range req .ConfigsUpdated {
98
97
if proxy .Type == model .Router {
99
98
if features .FilterGatewayClusterConfig {
100
99
if _ , f := pushCdsGatewayConfig [config .Kind ]; f {
101
100
return true
102
101
}
103
102
}
104
- if config .Kind == kind .Gateway && (autoPassthroughModeChanged || autoPassthroughHostsChanged ) {
105
- return true
103
+ if config .Kind == kind .Gateway {
104
+ // Do the check outside of the loop since its slow; just trigger we need it
105
+ checkGateway = true
106
106
}
107
107
}
108
108
109
109
if _ , f := skippedCdsConfigs [config .Kind ]; ! f {
110
110
return true
111
111
}
112
112
}
113
+ if checkGateway {
114
+ autoPassthroughModeChanged := proxy .MergedGateway .HasAutoPassthroughGateways () != proxy .PrevMergedGateway .HasAutoPassthroughGateway ()
115
+ autoPassthroughHostsChanged := ! proxy .MergedGateway .GetAutoPassthrughGatewaySNIHosts ().Equals (proxy .PrevMergedGateway .GetAutoPassthroughSNIHosts ())
116
+ if autoPassthroughModeChanged || autoPassthroughHostsChanged {
117
+ return true
118
+ }
119
+ }
113
120
return false
114
121
}
115
122
You can’t perform that action at this time.
0 commit comments