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