@@ -1370,6 +1370,8 @@ export class WorkspaceStarter {
1370
1370
1371
1371
const envvars : EnvironmentVariable [ ] = [ ] ;
1372
1372
1373
+ const sysEnvvars : EnvironmentVariable [ ] = [ ] ;
1374
+
1373
1375
// TODO(cw): for the time being we're still pushing the env vars as we did before.
1374
1376
// Once everything is running with the latest supervisor, we can stop doing that.
1375
1377
allEnvVars . forEach ( ( e ) => {
@@ -1384,27 +1386,27 @@ export class WorkspaceStarter {
1384
1386
const ideAliasEnv = new EnvironmentVariable ( ) ;
1385
1387
ideAliasEnv . setName ( "GITPOD_IDE_ALIAS" ) ;
1386
1388
ideAliasEnv . setValue ( ideAlias ) ;
1387
- envvars . push ( ideAliasEnv ) ;
1389
+ sysEnvvars . push ( ideAliasEnv ) ;
1388
1390
}
1389
1391
1390
1392
const contextUrlEnv = new EnvironmentVariable ( ) ;
1391
1393
contextUrlEnv . setName ( "GITPOD_WORKSPACE_CONTEXT_URL" ) ;
1392
1394
// Beware that `workspace.contextURL` is not normalized so it might contain other modifiers
1393
1395
// making it not a valid URL
1394
1396
contextUrlEnv . setValue ( workspace . context . normalizedContextURL || workspace . contextURL ) ;
1395
- envvars . push ( contextUrlEnv ) ;
1397
+ sysEnvvars . push ( contextUrlEnv ) ;
1396
1398
1397
1399
const contextEnv = new EnvironmentVariable ( ) ;
1398
1400
contextEnv . setName ( "GITPOD_WORKSPACE_CONTEXT" ) ;
1399
1401
contextEnv . setValue ( JSON . stringify ( workspace . context ) ) ;
1400
- envvars . push ( contextEnv ) ;
1402
+ sysEnvvars . push ( contextEnv ) ;
1401
1403
1402
1404
const info = this . config . workspaceClasses . find ( ( cls ) => cls . id === instance . workspaceClass ) ;
1403
1405
if ( ! ! info ) {
1404
1406
const workspaceClassInfoEnv = new EnvironmentVariable ( ) ;
1405
1407
workspaceClassInfoEnv . setName ( "GITPOD_WORKSPACE_CLASS_INFO" ) ;
1406
1408
workspaceClassInfoEnv . setValue ( JSON . stringify ( info ) ) ;
1407
- envvars . push ( workspaceClassInfoEnv ) ;
1409
+ sysEnvvars . push ( workspaceClassInfoEnv ) ;
1408
1410
}
1409
1411
1410
1412
log . debug ( "Workspace config" , workspace . config ) ;
@@ -1415,19 +1417,19 @@ export class WorkspaceStarter {
1415
1417
const ev = new EnvironmentVariable ( ) ;
1416
1418
ev . setName ( "GITPOD_TASKS" ) ;
1417
1419
ev . setValue ( JSON . stringify ( tasks ) ) ;
1418
- envvars . push ( ev ) ;
1420
+ sysEnvvars . push ( ev ) ;
1419
1421
}
1420
1422
1421
1423
const vsxRegistryUrl = new EnvironmentVariable ( ) ;
1422
1424
vsxRegistryUrl . setName ( "VSX_REGISTRY_URL" ) ;
1423
1425
vsxRegistryUrl . setValue ( this . config . vsxRegistryUrl ) ;
1424
- envvars . push ( vsxRegistryUrl ) ;
1426
+ sysEnvvars . push ( vsxRegistryUrl ) ;
1425
1427
1426
1428
// supervisor ensures dotfiles are only used if the workspace is a regular workspace
1427
1429
const dotfileEnv = new EnvironmentVariable ( ) ;
1428
1430
dotfileEnv . setName ( "SUPERVISOR_DOTFILE_REPO" ) ;
1429
1431
dotfileEnv . setValue ( user . additionalData ?. dotfileRepo || "" ) ;
1430
- envvars . push ( dotfileEnv ) ;
1432
+ sysEnvvars . push ( dotfileEnv ) ;
1431
1433
1432
1434
if ( workspace . config . coreDump ?. enabled ) {
1433
1435
// default core dump size is 262144 blocks (if blocksize is 4096)
@@ -1441,7 +1443,7 @@ export class WorkspaceStarter {
1441
1443
hardLimit : workspace . config . coreDump ?. hardLimit || defaultLimit ,
1442
1444
} ) ,
1443
1445
) ;
1444
- envvars . push ( rLimitCore ) ;
1446
+ sysEnvvars . push ( rLimitCore ) ;
1445
1447
}
1446
1448
1447
1449
const createGitpodTokenPromise = ( async ( ) => {
@@ -1475,7 +1477,7 @@ export class WorkspaceStarter {
1475
1477
} ,
1476
1478
] ) ,
1477
1479
) ;
1478
- envvars . push ( ev ) ;
1480
+ sysEnvvars . push ( ev ) ;
1479
1481
} ) ( ) ;
1480
1482
1481
1483
const portIndex = new Set < number > ( ) ;
@@ -1571,16 +1573,20 @@ export class WorkspaceStarter {
1571
1573
const spec = new StartWorkspaceSpec ( ) ;
1572
1574
await createGitpodTokenPromise ;
1573
1575
spec . setEnvvarsList ( envvars ) ;
1576
+ spec . setSysEnvvarsList ( sysEnvvars ) ;
1574
1577
spec . setGit ( this . createGitSpec ( workspace , user ) ) ;
1575
1578
spec . setPortsList ( ports ) ;
1576
1579
spec . setInitializer ( ( await initializerPromise ) . initializer ) ;
1580
+
1577
1581
const startWorkspaceSpecIDEImage = new IDEImage ( ) ;
1578
1582
startWorkspaceSpecIDEImage . setWebRef ( ideImage ) ;
1579
- startWorkspaceSpecIDEImage . setDesktopRef ( instance . configuration ?. desktopIdeImage || "" ) ;
1580
- startWorkspaceSpecIDEImage . setDesktopPluginRef ( instance . configuration ?. desktopIdePluginImage || "" ) ;
1581
- startWorkspaceSpecIDEImage . setSupervisorRef ( instance . configuration ?. supervisorImage || "" ) ;
1583
+ startWorkspaceSpecIDEImage . setSupervisorRef ( instance . configuration ?. supervisorImage ?? "" ) ;
1582
1584
spec . setIdeImage ( startWorkspaceSpecIDEImage ) ;
1583
- spec . setDeprecatedIdeImage ( ideImage ) ;
1585
+
1586
+ instance . configuration ?. desktopIdeImage ?? spec . addImageLayers ( instance . configuration ?. desktopIdeImage ! ) ;
1587
+ instance . configuration ?. desktopIdePluginImage ??
1588
+ spec . addImageLayers ( instance . configuration ?. desktopIdePluginImage ! ) ;
1589
+
1584
1590
spec . setWorkspaceImage ( instance . workspaceImage ) ;
1585
1591
spec . setWorkspaceLocation ( workspace . config . workspaceLocation || checkoutLocation ) ;
1586
1592
spec . setFeatureFlagsList ( this . toWorkspaceFeatureFlags ( featureFlags ) ) ;
0 commit comments