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