Skip to content

Commit 339dcb9

Browse files
author
Andrew Farries
committed
Set applicationCluster when registering cluster
Set the application cluster when registering a new workspace cluster. The applicationCluster is set to the value of the GITPOD_INSTALLATION_SHORTNAME env var which must be set in the environment of ws manager bridge.
1 parent 5fe5771 commit 339dcb9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ export class ClusterService implements IClusterServiceServer {
107107
}
108108
}
109109

110+
const applicationCluster = process.env.GITPOD_INSTALLATION_SHORTNAME;
111+
if (applicationCluster === undefined) {
112+
throw new GRPCError(
113+
grpc.status.INTERNAL,
114+
"no GITPOD_INSTALLATION_SHORTNAME environment variable is set on the server",
115+
);
116+
}
117+
110118
// store the ws-manager into the database
111119
let perfereability = Preferability.NONE;
112120
let govern = false;
@@ -141,6 +149,7 @@ export class ClusterService implements IClusterServiceServer {
141149
const newCluster: WorkspaceCluster = {
142150
name: req.name,
143151
url: req.url,
152+
applicationCluster,
144153
state,
145154
score,
146155
maxScore: 100,

0 commit comments

Comments
 (0)