Skip to content

Commit 8658fd5

Browse files
committed
grpc-js-xds: Remove LDS and CDS code for removing RDS and EDS entries
1 parent 68c5eed commit 8658fd5

File tree

4 files changed

+0
-39
lines changed

4 files changed

+0
-39
lines changed

packages/grpc-js-xds/src/xds-stream-state/cds-state.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,16 @@ export class CdsState implements XdsStreamState<Cluster__Output> {
149149
}
150150
this.latestResponses = validResponses;
151151
this.latestIsV2 = isV2;
152-
const allEdsServiceNames: Set<string> = new Set<string>();
153152
const allClusterNames: Set<string> = new Set<string>();
154153
for (const message of validResponses) {
155154
allClusterNames.add(message.name);
156-
const edsServiceName = message.eds_cluster_config?.service_name ?? '';
157-
allEdsServiceNames.add(
158-
edsServiceName === '' ? message.name : edsServiceName
159-
);
160155
const watchers = this.watchers.get(message.name) ?? [];
161156
for (const watcher of watchers) {
162157
watcher.onValidUpdate(message, isV2);
163158
}
164159
}
165160
trace('Received CDS updates for cluster names ' + Array.from(allClusterNames));
166161
this.handleMissingNames(allClusterNames);
167-
this.edsState.handleMissingNames(allEdsServiceNames);
168162
return errorMessage;
169163
}
170164

packages/grpc-js-xds/src/xds-stream-state/eds-state.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -128,23 +128,6 @@ export class EdsState implements XdsStreamState<ClusterLoadAssignment__Output> {
128128
return true;
129129
}
130130

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-
148131
handleResponses(responses: ClusterLoadAssignment__Output[], isV2: boolean) {
149132
const validResponses: ClusterLoadAssignment__Output[] = [];
150133
let errorMessage: string | null = null;

packages/grpc-js-xds/src/xds-stream-state/lds-state.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,15 @@ export class LdsState implements XdsStreamState<Listener__Output> {
167167
this.latestResponses = validResponses;
168168
this.latestIsV2 = isV2;
169169
const allTargetNames = new Set<string>();
170-
const allRouteConfigNames = new Set<string>();
171170
for (const message of validResponses) {
172171
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-
}
177172
const watchers = this.watchers.get(message.name) ?? [];
178173
for (const watcher of watchers) {
179174
watcher.onValidUpdate(message, isV2);
180175
}
181176
}
182177
trace('Received RDS response with route config names ' + Array.from(allTargetNames));
183178
this.handleMissingNames(allTargetNames);
184-
this.rdsState.handleMissingNames(allRouteConfigNames);
185179
return errorMessage;
186180
}
187181

packages/grpc-js-xds/src/xds-stream-state/rds-state.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,6 @@ export class RdsState implements XdsStreamState<RouteConfiguration__Output> {
172172
return true;
173173
}
174174

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-
185175
handleResponses(responses: RouteConfiguration__Output[], isV2: boolean): string | null {
186176
const validResponses: RouteConfiguration__Output[] = [];
187177
let errorMessage: string | null = null;

0 commit comments

Comments
 (0)