Skip to content

Commit

Permalink
Fix workspace class storage
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel committed Nov 8, 2023
1 parent cd42ce3 commit 2a9a442
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/gitpod-db/src/typeorm/workspace-cluster-db-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export class WorkspaceClusterDBImpl implements WorkspaceClusterDB {
state: "available",
govern: false,
admissionConstraints: [],
availableWorkspaceClasses: [],
preferredWorkspaceClass: "",
};

const repo = await this.getRepo();
Expand Down
17 changes: 17 additions & 0 deletions components/gitpod-db/src/workspace-cluster-db.spec.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ export class WorkspaceClusterDBSpec {
score: 0,
maxScore: 0,
govern: false,
availableWorkspaceClasses: [
{
id: "some-class",
displayName: "Some Class",
description: "Some class description",
creditsPerMinute: 0.5,
},
],
preferredWorkspaceClass: "some-class",
});
const wsc2: DBWorkspaceCluster = dbWorkspaceCluster({
name: "us71",
Expand All @@ -118,6 +127,14 @@ export class WorkspaceClusterDBSpec {
const wscs = await this.db.findFiltered({ name: "eu71" });
expect(wscs.length).to.equal(1);
expect(wscs[0].name).to.equal("eu71");
expect(wscs[0].availableWorkspaceClasses).to.deep.equal([
{
id: "some-class",
displayName: "Some Class",
description: "Some class description",
creditsPerMinute: 0.5,
},
]);
}

@test public async testFindFilteredByApplicationCluster() {
Expand Down

0 comments on commit 2a9a442

Please sign in to comment.