@@ -38,15 +38,15 @@ import (
38
38
type ResolverProvider func () remotes.Resolver
39
39
40
40
type IDEServiceServer struct {
41
- config * config.ServiceConfiguration
42
- originIDEConfig []byte
43
- parsedIDEConfigContent string
44
- parsedIDENonExperimental string
45
- ideConfig * config.IDEConfig
46
- nonExperimentalIDEConfig * config.IDEConfig
47
- ideConfigFileName string
48
- experimentsClient experiments.Client
49
- resolver ResolverProvider
41
+ config * config.ServiceConfiguration
42
+ originIDEConfig []byte
43
+ parsedIDEConfigContent string
44
+ parsedCode1_85IDEConfigContent string
45
+ ideConfig * config.IDEConfig
46
+ code1_85IdeConfig * config.IDEConfig
47
+ ideConfigFileName string
48
+ experimentsClient experiments.Client
49
+ resolver ResolverProvider
50
50
51
51
api.UnimplementedIDEServiceServer
52
52
}
@@ -176,70 +176,71 @@ func (s *IDEServiceServer) GetConfig(ctx context.Context, req *api.GetConfigRequ
176
176
UserEmail : req .User .GetEmail (),
177
177
}
178
178
179
- experimentalIdesEnabled := s .experimentsClient .GetBoolValue (ctx , "experimentalIdes" , false , attributes )
179
+ // Check flag to enable vscode for older linux distros (distros that don't support glibc 2.28)
180
+ enableVscodeForOlderLinuxDistros := s .experimentsClient .GetBoolValue (ctx , "enableVscodeForOlderLinuxDistros" , false , attributes )
180
181
181
- if experimentalIdesEnabled {
182
+ if enableVscodeForOlderLinuxDistros {
182
183
return & api.GetConfigResponse {
183
- Content : s .parsedIDEConfigContent ,
184
+ Content : s .parsedCode1_85IDEConfigContent ,
184
185
}, nil
185
186
} else {
186
187
return & api.GetConfigResponse {
187
- Content : s .parsedIDENonExperimental ,
188
+ Content : s .parsedIDEConfigContent ,
188
189
}, nil
189
190
}
190
191
}
191
192
192
193
func (s * IDEServiceServer ) readIDEConfig (ctx context.Context , isInit bool ) {
193
- b , err := os .ReadFile (s .ideConfigFileName )
194
+ ideConfigbuffer , err := os .ReadFile (s .ideConfigFileName )
194
195
if err != nil {
195
- log .WithError (err ).Warn ("cannot read ide config file" )
196
+ log .WithError (err ).Warn ("cannot read original ide config file" )
196
197
return
197
198
}
198
- if ideConfig , err := ParseConfig (ctx , s .resolver (), b ); err != nil {
199
+ if originalIdeConfig , err := ParseConfig (ctx , s .resolver (), ideConfigbuffer ); err != nil {
199
200
if ! isInit {
200
- log .WithError (err ).Fatal ("cannot parse ide config" )
201
+ log .WithError (err ).Fatal ("cannot parse original ide config" )
201
202
}
202
- log .WithError (err ).Error ("cannot parse ide config" )
203
+ log .WithError (err ).Error ("cannot parse original ide config" )
203
204
return
204
205
} else {
205
- parsedConfig , err := json .Marshal (ideConfig )
206
+ parsedConfig , err := json .Marshal (originalIdeConfig )
206
207
if err != nil {
207
- log .WithError (err ).Error ("cannot marshal ide config" )
208
+ log .WithError (err ).Error ("cannot marshal original ide config" )
208
209
return
209
210
}
210
211
211
- // Precompute the config without experimental IDEs
212
- ideOptions := ideConfig .IdeOptions .Options
213
- nonExperimentalIdeOptions := make (map [string ]config.IDEOption )
214
- for key , ide := range ideOptions {
215
- if ! ide . Experimental {
216
- nonExperimentalIdeOptions [key ] = ide
212
+ // Precompute the config without code 1.85
213
+ code1_85IdeOptions := originalIdeConfig .IdeOptions .Options
214
+ ideOptions := make (map [string ]config.IDEOption )
215
+ for key , ide := range code1_85IdeOptions {
216
+ if key != "code1_85" {
217
+ ideOptions [key ] = ide
217
218
}
218
219
}
219
220
220
- nonExperimentalConfig := & config.IDEConfig {
221
- SupervisorImage : ideConfig .SupervisorImage ,
221
+ ideConfig := & config.IDEConfig {
222
+ SupervisorImage : originalIdeConfig .SupervisorImage ,
222
223
IdeOptions : config.IDEOptions {
223
- Options : nonExperimentalIdeOptions ,
224
- DefaultIde : ideConfig .IdeOptions .DefaultIde ,
225
- DefaultDesktopIde : ideConfig .IdeOptions .DefaultDesktopIde ,
226
- Clients : ideConfig .IdeOptions .Clients ,
224
+ Options : ideOptions ,
225
+ DefaultIde : originalIdeConfig .IdeOptions .DefaultIde ,
226
+ DefaultDesktopIde : originalIdeConfig .IdeOptions .DefaultDesktopIde ,
227
+ Clients : originalIdeConfig .IdeOptions .Clients ,
227
228
},
228
229
}
229
230
230
- parsedNonExperimentalConfig , err := json .Marshal (nonExperimentalConfig )
231
+ parsedIdeConfig , err := json .Marshal (ideConfig )
231
232
if err != nil {
232
- log .WithError (err ).Error ("cannot marshal non-experimental ide config" )
233
+ log .WithError (err ).Error ("cannot marshal ide config" )
233
234
return
234
235
}
235
236
236
- s .parsedIDEConfigContent = string (parsedConfig )
237
- s .ideConfig = ideConfig
237
+ s .parsedCode1_85IDEConfigContent = string (parsedConfig )
238
+ s .code1_85IdeConfig = originalIdeConfig
238
239
239
- s .nonExperimentalIDEConfig = nonExperimentalConfig
240
- s .parsedIDENonExperimental = string (parsedNonExperimentalConfig )
240
+ s .ideConfig = ideConfig
241
+ s .parsedIDEConfigContent = string (parsedIdeConfig )
241
242
242
- s .originIDEConfig = b
243
+ s .originIDEConfig = ideConfigbuffer
243
244
244
245
log .Info ("ide config updated" )
245
246
}
@@ -353,7 +354,7 @@ func (s *IDEServiceServer) ResolveWorkspaceConfig(ctx context.Context, req *api.
353
354
log .WithField ("req" , req ).Debug ("receive ResolveWorkspaceConfig request" )
354
355
355
356
// make a copy for ref ideConfig, it's safe because we replace ref in update config
356
- ideConfig := s .ideConfig
357
+ ideConfig := s .code1_85IdeConfig
357
358
358
359
var defaultIde * config.IDEOption
359
360
0 commit comments