diff --git a/api/restHandler/app/pipeline/configure/BuildPipelineRestHandler.go b/api/restHandler/app/pipeline/configure/BuildPipelineRestHandler.go index 84dbedb6c5..c18937537e 100644 --- a/api/restHandler/app/pipeline/configure/BuildPipelineRestHandler.go +++ b/api/restHandler/app/pipeline/configure/BuildPipelineRestHandler.go @@ -1191,7 +1191,11 @@ func (handler *PipelineConfigRestHandlerImpl) GetBuildLogs(w http.ResponseWriter }(ctx.Done(), cn.CloseNotify()) } defer cancel() - defer cleanUp() + defer func() { + if cleanUp != nil { + cleanUp() + } + }() handler.streamOutput(w, logsReader, lastSeenMsgId) } diff --git a/api/restHandler/app/pipeline/configure/DeploymentPipelineRestHandler.go b/api/restHandler/app/pipeline/configure/DeploymentPipelineRestHandler.go index fbc241d0b3..b0a1f57512 100644 --- a/api/restHandler/app/pipeline/configure/DeploymentPipelineRestHandler.go +++ b/api/restHandler/app/pipeline/configure/DeploymentPipelineRestHandler.go @@ -1808,7 +1808,11 @@ func (handler *PipelineConfigRestHandlerImpl) GetPrePostDeploymentLogs(w http.Re }(ctx.Done(), cn.CloseNotify()) } defer cancel() - defer cleanUp() + defer func() { + if cleanUp != nil { + cleanUp() + } + }() handler.streamOutput(w, logsReader, lastSeenMsgId) } diff --git a/pkg/pipeline/CiHandler.go b/pkg/pipeline/CiHandler.go index 1df5e4f428..0c4860c3a9 100644 --- a/pkg/pipeline/CiHandler.go +++ b/pkg/pipeline/CiHandler.go @@ -825,7 +825,7 @@ func (impl *CiHandlerImpl) GetRunningWorkflowLogs(workflowId int) (*bufio.Reader func (impl *CiHandlerImpl) getWorkflowLogs(ciWorkflow *pipelineConfig.CiWorkflow) (*bufio.Reader, func() error, error) { if string(v1alpha1.NodePending) == ciWorkflow.PodStatus { - return bufio.NewReader(strings.NewReader("")), nil, nil + return bufio.NewReader(strings.NewReader("")), func() error { return nil }, nil } ciLogRequest := types.BuildLogRequest{ PodName: ciWorkflow.PodName,