@@ -14,17 +14,17 @@ export interface WorkspaceManagerClientProviderSource {
14
14
getAllWorkspaceClusters ( ) : Promise < WorkspaceClusterWoTLS [ ] > ;
15
15
}
16
16
17
+
17
18
@injectable ( )
18
19
export class WorkspaceManagerClientProviderEnvSource implements WorkspaceManagerClientProviderSource {
19
20
protected _clusters : WorkspaceCluster [ ] | undefined = undefined ;
20
- readonly applicationCluster = process . env . GITPOD_INSTALLATION_SHORTNAME ?? "" ;
21
21
22
22
public async getWorkspaceCluster ( name : string ) : Promise < WorkspaceCluster | undefined > {
23
- return this . clusters . find ( ( m ) => m . name === name && m . applicationCluster === this . applicationCluster ) ;
23
+ return this . clusters . find ( m => m . name === name ) ;
24
24
}
25
25
26
26
public async getAllWorkspaceClusters ( ) : Promise < WorkspaceClusterWoTLS [ ] > {
27
- return this . clusters . filter ( ( m ) => m . applicationCluster === this . applicationCluster ) ?? [ ] ;
27
+ return this . clusters ;
28
28
}
29
29
30
30
protected get clusters ( ) : WorkspaceCluster [ ] {
@@ -63,14 +63,13 @@ export class WorkspaceManagerClientProviderEnvSource implements WorkspaceManager
63
63
export class WorkspaceManagerClientProviderDBSource implements WorkspaceManagerClientProviderSource {
64
64
@inject ( WorkspaceClusterDB )
65
65
protected readonly db : WorkspaceClusterDB ;
66
- readonly applicationCluster = process . env . GITPOD_INSTALLATION_SHORTNAME ?? "" ;
67
66
68
67
public async getWorkspaceCluster ( name : string ) : Promise < WorkspaceCluster | undefined > {
69
- return ( await this . db . findFiltered ( { name, applicationCluster : this . applicationCluster } ) ) [ 0 ] ;
68
+ return await this . db . findByName ( name ) ;
70
69
}
71
70
72
71
public async getAllWorkspaceClusters ( ) : Promise < WorkspaceClusterWoTLS [ ] > {
73
- return await this . db . findFiltered ( { applicationCluster : this . applicationCluster } ) ;
72
+ return await this . db . findFiltered ( { } ) ;
74
73
}
75
74
}
76
75
@@ -106,4 +105,4 @@ export class WorkspaceManagerClientProviderCompositeSource implements WorkspaceM
106
105
}
107
106
return result ;
108
107
}
109
- }
108
+ }
0 commit comments