File tree Expand file tree Collapse file tree 4 files changed +0
-39
lines changed
packages/grpc-js-xds/src/xds-stream-state Expand file tree Collapse file tree 4 files changed +0
-39
lines changed Original file line number Diff line number Diff line change @@ -149,22 +149,16 @@ export class CdsState implements XdsStreamState<Cluster__Output> {
149
149
}
150
150
this . latestResponses = validResponses ;
151
151
this . latestIsV2 = isV2 ;
152
- const allEdsServiceNames : Set < string > = new Set < string > ( ) ;
153
152
const allClusterNames : Set < string > = new Set < string > ( ) ;
154
153
for ( const message of validResponses ) {
155
154
allClusterNames . add ( message . name ) ;
156
- const edsServiceName = message . eds_cluster_config ?. service_name ?? '' ;
157
- allEdsServiceNames . add (
158
- edsServiceName === '' ? message . name : edsServiceName
159
- ) ;
160
155
const watchers = this . watchers . get ( message . name ) ?? [ ] ;
161
156
for ( const watcher of watchers ) {
162
157
watcher . onValidUpdate ( message , isV2 ) ;
163
158
}
164
159
}
165
160
trace ( 'Received CDS updates for cluster names ' + Array . from ( allClusterNames ) ) ;
166
161
this . handleMissingNames ( allClusterNames ) ;
167
- this . edsState . handleMissingNames ( allEdsServiceNames ) ;
168
162
return errorMessage ;
169
163
}
170
164
Original file line number Diff line number Diff line change @@ -128,23 +128,6 @@ export class EdsState implements XdsStreamState<ClusterLoadAssignment__Output> {
128
128
return true ;
129
129
}
130
130
131
- /**
132
- * Given a list of edsServiceNames (which may actually be the cluster name),
133
- * for each watcher watching a name not on the list, call that watcher's
134
- * onResourceDoesNotExist method.
135
- * @param allClusterNames
136
- */
137
- handleMissingNames ( allEdsServiceNames : Set < string > ) {
138
- for ( const [ edsServiceName , watcherList ] of this . watchers . entries ( ) ) {
139
- if ( ! allEdsServiceNames . has ( edsServiceName ) ) {
140
- trace ( 'Reporting EDS resource does not exist for edsServiceName ' + edsServiceName ) ;
141
- for ( const watcher of watcherList ) {
142
- watcher . onResourceDoesNotExist ( ) ;
143
- }
144
- }
145
- }
146
- }
147
-
148
131
handleResponses ( responses : ClusterLoadAssignment__Output [ ] , isV2 : boolean ) {
149
132
const validResponses : ClusterLoadAssignment__Output [ ] = [ ] ;
150
133
let errorMessage : string | null = null ;
Original file line number Diff line number Diff line change @@ -167,21 +167,15 @@ export class LdsState implements XdsStreamState<Listener__Output> {
167
167
this . latestResponses = validResponses ;
168
168
this . latestIsV2 = isV2 ;
169
169
const allTargetNames = new Set < string > ( ) ;
170
- const allRouteConfigNames = new Set < string > ( ) ;
171
170
for ( const message of validResponses ) {
172
171
allTargetNames . add ( message . name ) ;
173
- const httpConnectionManager = decodeSingleResource ( HTTP_CONNECTION_MANGER_TYPE_URL_V3 , message . api_listener ! . api_listener ! . value ) ;
174
- if ( httpConnectionManager . rds ) {
175
- allRouteConfigNames . add ( httpConnectionManager . rds . route_config_name ) ;
176
- }
177
172
const watchers = this . watchers . get ( message . name ) ?? [ ] ;
178
173
for ( const watcher of watchers ) {
179
174
watcher . onValidUpdate ( message , isV2 ) ;
180
175
}
181
176
}
182
177
trace ( 'Received RDS response with route config names ' + Array . from ( allTargetNames ) ) ;
183
178
this . handleMissingNames ( allTargetNames ) ;
184
- this . rdsState . handleMissingNames ( allRouteConfigNames ) ;
185
179
return errorMessage ;
186
180
}
187
181
Original file line number Diff line number Diff line change @@ -172,16 +172,6 @@ export class RdsState implements XdsStreamState<RouteConfiguration__Output> {
172
172
return true ;
173
173
}
174
174
175
- handleMissingNames ( allRouteConfigNames : Set < string > ) {
176
- for ( const [ routeConfigName , watcherList ] of this . watchers . entries ( ) ) {
177
- if ( ! allRouteConfigNames . has ( routeConfigName ) ) {
178
- for ( const watcher of watcherList ) {
179
- watcher . onResourceDoesNotExist ( ) ;
180
- }
181
- }
182
- }
183
- }
184
-
185
175
handleResponses ( responses : RouteConfiguration__Output [ ] , isV2 : boolean ) : string | null {
186
176
const validResponses : RouteConfiguration__Output [ ] = [ ] ;
187
177
let errorMessage : string | null = null ;
You can’t perform that action at this time.
0 commit comments