@@ -41,6 +41,11 @@ export interface WorkspaceGarbageCollection {
41
41
contentChunkLimit : number ;
42
42
}
43
43
44
+ enum LicenseType {
45
+ Legacy = 'legacy' ,
46
+ Replicated = 'replicated' ,
47
+ }
48
+
44
49
/**
45
50
* This is the config shape as found in the configuration file, e.g. server-configmap.yaml
46
51
*/
@@ -57,6 +62,9 @@ export interface ConfigSerialized {
57
62
license ?: string ;
58
63
licenseFile ?: string ;
59
64
65
+ licenseType ?: LicenseType ;
66
+ LicenseTypeFile ?: string ; // Value written to file
67
+
60
68
workspaceHeartbeat : {
61
69
intervalSeconds : number ;
62
70
timeoutSeconds : number ,
@@ -195,6 +203,18 @@ export namespace ConfigFile {
195
203
if ( licenseFile ) {
196
204
license = fs . readFileSync ( filePathTelepresenceAware ( licenseFile ) , "utf-8" ) ;
197
205
}
206
+ let licenseType = config . licenseType ;
207
+ const licenseTypeFile = config . LicenseTypeFile ;
208
+ if ( licenseTypeFile ) {
209
+ // Default to legacy
210
+ licenseType = LicenseType . Legacy ;
211
+
212
+ const licenseTypeFileData = fs . readFileSync ( filePathTelepresenceAware ( licenseTypeFile ) , "utf-8" ) as LicenseType ;
213
+ if ( Object . values ( LicenseType ) . includes ( licenseTypeFileData ) ) {
214
+ // Valid licensor type
215
+ licenseType = licenseTypeFileData ;
216
+ }
217
+ }
198
218
return {
199
219
...config ,
200
220
stage : translateLegacyStagename ( config . stage ) ,
@@ -203,6 +223,7 @@ export namespace ConfigFile {
203
223
builtinAuthProvidersConfigured,
204
224
chargebeeProviderOptions,
205
225
license,
226
+ licenseType,
206
227
workspaceGarbageCollection : {
207
228
...config . workspaceGarbageCollection ,
208
229
startDate : config . workspaceGarbageCollection . startDate ? new Date ( config . workspaceGarbageCollection . startDate ) . getTime ( ) : Date . now ( ) ,
0 commit comments