Fix: change the output

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
This commit is contained in:
barnettZQG
2022-10-29 18:07:22 +08:00
committed by Qiaozp
parent 7a90e7e310
commit 595a871b0d
2 changed files with 3 additions and 7 deletions
+3 -5
View File
@@ -320,8 +320,7 @@ func (p pipelineRunServiceImpl) GetPipelineRunOutput(ctx context.Context, pipeli
}
ctxBackend := pipelineRun.Status.ContextBackend
if ctxBackend == nil {
log.Logger.Errorf("context backend is nil")
return apis.GetPipelineRunOutputResponse{}, bcode.ErrContextBackendNil
return apis.GetPipelineRunOutputResponse{}, nil
}
v, err := wfUtils.GetDataFromContext(ctx, p.KubeClient, ctxBackend.Name, pipelineRun.PipelineRunName, ctxBackend.Namespace)
if err != nil {
@@ -377,8 +376,7 @@ func (p pipelineRunServiceImpl) GetPipelineRunInput(ctx context.Context, pipelin
}
ctxBackend := pipelineRun.Status.ContextBackend
if ctxBackend == nil {
log.Logger.Errorf("context backend is nil")
return apis.GetPipelineRunInputResponse{}, bcode.ErrContextBackendNil
return apis.GetPipelineRunInputResponse{}, nil
}
v, err := wfUtils.GetDataFromContext(ctx, p.KubeClient, ctxBackend.Name, pipelineRun.PipelineRunName, ctxBackend.Namespace)
if err != nil {
@@ -428,7 +426,7 @@ func haveSubSteps(step *v1alpha1.WorkflowStepStatus, subStep string) (*v1alpha1.
func (p pipelineRunServiceImpl) GetPipelineRunLog(ctx context.Context, pipelineRun apis.PipelineRun, step string) (apis.GetPipelineRunLogResponse, error) {
project := ctx.Value(&apis.CtxKeyProject).(*model.Project)
if pipelineRun.Status.ContextBackend == nil {
return apis.GetPipelineRunLogResponse{}, bcode.ErrContextBackendNil
return apis.GetPipelineRunLogResponse{}, nil
}
logConfig, err := wfUtils.GetLogConfigFromStep(ctx, p.KubeClient, pipelineRun.Status.ContextBackend.Name, pipelineRun.PipelineName, project.GetNamespace(), step)
@@ -25,8 +25,6 @@ var (
ErrGetPipelineInfo = NewBcode(400, 17003, "get pipeline info failed")
// ErrFindingLogPods means no valid pod found
ErrFindingLogPods = NewBcode(400, 17004, "failed to find log pods")
// ErrContextBackendNil means context backend field is nil
ErrContextBackendNil = NewBcode(400, 17005, "no context backend found in pipeline")
// ErrGetPodsLogs means failed to get pods logs
ErrGetPodsLogs = NewBcode(500, 17006, "failed to get pods logs")
// ErrReadSourceLog means failed to read source log