@@ -181,6 +181,11 @@ func Run(options ...RunOption) {
181
181
return
182
182
}
183
183
184
+ // Note(cw): legacy rungp behaviour
185
+ if opts .RunGP {
186
+ cfg .WorkspaceRuntime = WorkspaceRuntimeRunGP
187
+ }
188
+
184
189
// BEWARE: we can only call buildChildProcEnv once, because it might download env vars from a one-time-secret
185
190
// URL, which would fail if we tried another time.
186
191
childProcEnvvars = buildChildProcEnv (cfg , nil , opts .RunGP )
@@ -200,7 +205,7 @@ func Run(options ...RunOption) {
200
205
201
206
tokenService := NewInMemoryTokenService ()
202
207
203
- if ! opts . RunGP {
208
+ if cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP {
204
209
tkns , err := cfg .GetTokens (true )
205
210
if err != nil {
206
211
log .WithError (err ).Warn ("cannot prepare tokens" )
@@ -264,7 +269,7 @@ func Run(options ...RunOption) {
264
269
notificationService = NewNotificationService ()
265
270
)
266
271
267
- if ! opts . RunGP {
272
+ if cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP {
268
273
gitpodService = serverapi .NewServerApiService (ctx , & serverapi.ServiceConfig {
269
274
Host : host ,
270
275
Endpoint : endpoint ,
@@ -279,7 +284,7 @@ func Run(options ...RunOption) {
279
284
if cfg .GetDesktopIDE () != nil {
280
285
desktopIdeReady = & ideReadyState {cond : sync .NewCond (& sync.Mutex {})}
281
286
}
282
- if ! cfg .isHeadless () && ! opts . RunGP && ! cfg .isDebugWorkspace () {
287
+ if ! cfg .isHeadless () && cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP && ! cfg .isDebugWorkspace () {
283
288
go trackReadiness (ctx , telemetry , cfg , cstate , ideReady , desktopIdeReady )
284
289
}
285
290
tokenService .provider [KindGit ] = []tokenProvider {NewGitTokenProvider (gitpodService , cfg .WorkspaceConfig , notificationService )}
@@ -289,7 +294,7 @@ func Run(options ...RunOption) {
289
294
290
295
var exposedPorts ports.ExposedPortsInterface
291
296
292
- if ! opts . RunGP {
297
+ if cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP {
293
298
exposedPorts = createExposedPortsImpl (cfg , gitpodService )
294
299
}
295
300
@@ -304,18 +309,18 @@ func Run(options ...RunOption) {
304
309
)
305
310
306
311
topService := NewTopService ()
307
- if ! opts . RunGP {
312
+ if cfg . WorkspaceRuntime == WorkspaceRuntimeContainer {
308
313
topService .Observe (ctx )
309
314
}
310
315
311
- if ! cfg .isHeadless () && ! opts . RunGP {
316
+ if ! cfg .isHeadless () && cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP {
312
317
go analyseConfigChanges (ctx , cfg , telemetry , gitpodConfigService )
313
318
go analysePerfChanges (ctx , cfg , telemetry , topService )
314
319
}
315
320
316
321
supervisorMetrics := metrics .NewMetrics ()
317
322
var metricsReporter * metrics.GrpcMetricsReporter
318
- if ! opts . RunGP && ! cfg .isDebugWorkspace () && ! strings .Contains ("ephemeral" , cfg .WorkspaceClusterHost ) {
323
+ if cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP && ! cfg .isDebugWorkspace () && ! strings .Contains ("ephemeral" , cfg .WorkspaceClusterHost ) {
319
324
_ , gitpodHost , err := cfg .GitpodAPIEndpoint ()
320
325
if err != nil {
321
326
log .WithError (err ).Error ("grpc metrics: failed to parse gitpod host" )
@@ -355,7 +360,7 @@ func Run(options ...RunOption) {
355
360
356
361
gitStatusWg := & sync.WaitGroup {}
357
362
gitStatusCtx , stopGitStatus := context .WithCancel (ctx )
358
- if ! cfg .isPrebuild () && ! cfg .isHeadless () && ! opts . RunGP && ! cfg .isDebugWorkspace () {
363
+ if ! cfg .isPrebuild () && ! cfg .isHeadless () && cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP && ! cfg .isDebugWorkspace () {
359
364
gitStatusWg .Add (1 )
360
365
gitStatusService := & GitStatusService {
361
366
cfg : cfg ,
@@ -406,7 +411,7 @@ func Run(options ...RunOption) {
406
411
shutdown = make (chan ShutdownReason , 1 )
407
412
)
408
413
409
- if opts . RunGP {
414
+ if cfg . WorkspaceRuntime == WorkspaceRuntimeRunGP {
410
415
cstate .MarkContentReady (csapi .WorkspaceInitFromOther )
411
416
} else if cfg .isDebugWorkspace () {
412
417
cstate .MarkContentReady (cfg .GetDebugWorkspaceContentSource ())
@@ -425,15 +430,15 @@ func Run(options ...RunOption) {
425
430
tasksSuccessChan := make (chan taskSuccess , 1 )
426
431
go taskManager .Run (ctx , & wg , tasksSuccessChan )
427
432
428
- if ! opts . RunGP {
433
+ if cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP {
429
434
wg .Add (1 )
430
435
go socketActivationForDocker (ctx , & wg , termMux , cfg , telemetry , notificationService , cstate )
431
436
}
432
437
433
438
if cfg .isHeadless () {
434
439
wg .Add (1 )
435
440
go stopWhenTasksAreDone (ctx , & wg , shutdown , tasksSuccessChan )
436
- } else if ! opts . RunGP {
441
+ } else if cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP {
437
442
wg .Add (1 )
438
443
go portMgmt .Run (ctx , & wg )
439
444
}
@@ -449,7 +454,7 @@ func Run(options ...RunOption) {
449
454
}()
450
455
}
451
456
452
- if ! cfg .isPrebuild () && ! opts . RunGP && ! cfg .isDebugWorkspace () {
457
+ if ! cfg .isPrebuild () && cfg . WorkspaceRuntime != WorkspaceRuntimeRunGP && ! cfg .isDebugWorkspace () {
453
458
go func () {
454
459
for _ , repoRoot := range strings .Split (cfg .RepoRoots , "," ) {
455
460
<- cstate .ContentReady ()
0 commit comments