Skip to content

Commit 9fddc74

Browse files
authored
[wsman-bridge] Remove worksplace classes feature flag (#17952)
1 parent 6755b23 commit 9fddc74

File tree

4 files changed

+16
-133
lines changed

4 files changed

+16
-133
lines changed

components/ws-manager-bridge/src/cluster-service-server.ts

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ import {
4040
import * as grpc from "@grpc/grpc-js";
4141
import { inject, injectable } from "inversify";
4242
import { BridgeController } from "./bridge-controller";
43-
import { getSupportedWorkspaceClasses } from "./cluster-sync-service";
4443
import { Configuration } from "./config";
4544
import { GRPCError } from "./rpc";
4645
import { isWorkspaceRegion } from "@gitpod/gitpod-protocol/lib/workspace-cluster";
47-
import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server";
4846
import { GetWorkspacesRequest, WorkspaceManagerClient } from "@gitpod/ws-manager/lib";
4947

5048
export interface ClusterServiceServerOptions {
@@ -148,34 +146,25 @@ export class ClusterService implements IClusterServiceServer {
148146
maxScore: 100,
149147
govern,
150148
tls,
149+
admissionConstraints,
151150
};
152151

153-
const enabled = await getExperimentsClientForBackend().getValueAsync(
154-
"workspace_classes_backend",
155-
false,
156-
{},
157-
);
158-
if (enabled) {
159-
let classConstraints = await getSupportedWorkspaceClasses(this.clientProvider, newCluster, false);
160-
newCluster.admissionConstraints = admissionConstraints.concat(classConstraints);
161-
} else {
162-
// try to connect to validate the config. Throws an exception if it fails.
163-
await new Promise<void>((resolve, reject) => {
164-
const c = this.clientProvider.createConnection(WorkspaceManagerClient, newCluster);
165-
c.getWorkspaces(new GetWorkspacesRequest(), (err: any) => {
166-
if (err) {
167-
reject(
168-
new GRPCError(
169-
grpc.status.FAILED_PRECONDITION,
170-
`cannot reach ${req.url}: ${err.message}`,
171-
),
172-
);
173-
} else {
174-
resolve();
175-
}
176-
});
152+
// try to connect to validate the config. Throws an exception if it fails.
153+
await new Promise<void>((resolve, reject) => {
154+
const c = this.clientProvider.createConnection(WorkspaceManagerClient, newCluster);
155+
c.getWorkspaces(new GetWorkspacesRequest(), (err: any) => {
156+
if (err) {
157+
reject(
158+
new GRPCError(
159+
grpc.status.FAILED_PRECONDITION,
160+
`cannot reach ${req.url}: ${err.message}`,
161+
),
162+
);
163+
} else {
164+
resolve();
165+
}
177166
});
178-
}
167+
});
179168

180169
await this.clusterDB.save(newCluster);
181170
log.info({}, "cluster registered", { cluster: req.name });

components/ws-manager-bridge/src/cluster-sync-service.ts

Lines changed: 0 additions & 100 deletions
This file was deleted.

components/ws-manager-bridge/src/container-module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { PrebuildUpdater, PrebuildUpdaterNoOp } from "./prebuild-updater";
3636
import { DebugApp } from "@gitpod/gitpod-protocol/lib/util/debug-app";
3737
import { Client } from "@gitpod/gitpod-protocol/lib/experiments/types";
3838
import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server";
39-
import { ClusterSyncService } from "./cluster-sync-service";
4039
import { WorkspaceInstanceController, WorkspaceInstanceControllerImpl } from "./workspace-instance-controller";
4140
import { AppClusterWorkspaceInstancesController } from "./app-cluster-instance-controller";
4241

@@ -61,7 +60,6 @@ export const containerModule = new ContainerModule((bind) => {
6160

6261
bind(ClusterServiceServer).toSelf().inSingletonScope();
6362
bind(ClusterService).toSelf().inRequestScope();
64-
bind(ClusterSyncService).toSelf().inSingletonScope();
6563

6664
bind(TracingManager).toSelf().inSingletonScope();
6765

components/ws-manager-bridge/src/main.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { TypeORM } from "@gitpod/gitpod-db/lib/typeorm/typeorm";
1414
import { TracingManager } from "@gitpod/gitpod-protocol/lib/util/tracing";
1515
import { ClusterServiceServer } from "./cluster-service-server";
1616
import { BridgeController } from "./bridge-controller";
17-
import { ClusterSyncService } from "./cluster-sync-service";
1817
import { AppClusterWorkspaceInstancesController } from "./app-cluster-instance-controller";
1918

2019
log.enableJSONLogging("ws-manager-bridge", undefined, LogrusLogLevel.getFromEnv());
@@ -50,9 +49,6 @@ export const start = async (container: Container) => {
5049
const clusterServiceServer = container.get<ClusterServiceServer>(ClusterServiceServer);
5150
await clusterServiceServer.start();
5251

53-
const clusterSyncService = container.get<ClusterSyncService>(ClusterSyncService);
54-
clusterSyncService.start();
55-
5652
const appClusterInstanceController = container.get<AppClusterWorkspaceInstancesController>(
5753
AppClusterWorkspaceInstancesController,
5854
);

0 commit comments

Comments
 (0)