@@ -109,7 +109,7 @@ import {
109
109
RemotePageMessage ,
110
110
RemoteTrackMessage ,
111
111
} from "@gitpod/gitpod-protocol/lib/analytics" ;
112
- import { ImageBuilderClientProvider , LogsRequest } from "@gitpod/image-builder/lib" ;
112
+ import { ImageBuilderClientProvider } from "@gitpod/image-builder/lib" ;
113
113
import { WorkspaceManagerClientProvider } from "@gitpod/ws-manager/lib/client-provider" ;
114
114
import {
115
115
ControlPortRequest ,
@@ -1559,11 +1559,11 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1559
1559
// during roll-out this is our fall-back case.
1560
1560
// Afterwards we might want to do some spinning-lock and re-check for a certain period (30s?) to give db-sync
1561
1561
// a change to move the imageBuildLogInfo across the globe.
1562
-
1563
- log . warn ( logCtx , "imageBuild logs: fallback!" ) ;
1564
- ctx . span ?. setTag ( "workspace.imageBuild.logs.fallback" , true ) ;
1565
- await this . deprecatedDoWatchWorkspaceImageBuildLogs ( ctx , logCtx , user , workspace ) ;
1566
- return ;
1562
+ log . error ( logCtx , "cannot watch imagebuild logs for workspaceId: no image build info available" ) ;
1563
+ throw new ResponseError (
1564
+ ErrorCodes . HEADLESS_LOG_NOT_YET_AVAILABLE ,
1565
+ "cannot watch imagebuild logs for workspaceId" ,
1566
+ ) ;
1567
1567
}
1568
1568
1569
1569
const aborted = new Deferred < boolean > ( ) ;
@@ -1608,47 +1608,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1608
1608
}
1609
1609
}
1610
1610
1611
- protected async deprecatedDoWatchWorkspaceImageBuildLogs (
1612
- ctx : TraceContext ,
1613
- logCtx : LogContext ,
1614
- user : User ,
1615
- workspace : Workspace ,
1616
- ) {
1617
- if ( ! workspace . imageNameResolved ) {
1618
- log . debug ( logCtx , `No imageNameResolved set for workspaceId, cannot watch logs.` ) ;
1619
- return ;
1620
- }
1621
-
1622
- try {
1623
- const imgbuilder = await this . imageBuilderClientProvider . getDefault (
1624
- user ,
1625
- workspace ,
1626
- { } as WorkspaceInstance ,
1627
- ) ;
1628
- const req = new LogsRequest ( ) ;
1629
- req . setCensored ( true ) ;
1630
- req . setBuildRef ( workspace . imageNameResolved ) ;
1631
-
1632
- let lineCount = 0 ;
1633
- await imgbuilder . logs ( ctx , req , ( data ) => {
1634
- if ( ! this . client ) {
1635
- return "stop" ;
1636
- }
1637
- data = data . replace ( "\n" , WorkspaceImageBuild . LogLine . DELIMITER ) ;
1638
- lineCount += data . split ( WorkspaceImageBuild . LogLine . DELIMITER_REGEX ) . length ;
1639
-
1640
- this . client . onWorkspaceImageBuildLogs ( undefined as any , {
1641
- text : data ,
1642
- isDiff : true ,
1643
- upToLine : lineCount ,
1644
- } ) ;
1645
- return "continue" ;
1646
- } ) ;
1647
- } catch ( err ) {
1648
- log . error ( logCtx , `cannot watch logs for workspaceId` , err ) ;
1649
- }
1650
- }
1651
-
1652
1611
async getHeadlessLog ( ctx : TraceContext , instanceId : string ) : Promise < HeadlessLogUrls > {
1653
1612
traceAPIParams ( ctx , { instanceId } ) ;
1654
1613
0 commit comments