Skip to content

Commit

Permalink
fix: for pod that's been GC'ed we need to get the log from the artifa…
Browse files Browse the repository at this point in the history
…ct (#9540)
  • Loading branch information
juliev0 authored Sep 8, 2022
1 parent 34a4e48 commit 9d66b69
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/src/app/shared/services/workflows-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,16 @@ export class WorkflowsService {
if (archived) {
return getLogsFromArtifact();
}

// return archived log if main container is finished and has artifact
return this.getContainerLogsFromCluster(workflow, podName, container, grep).pipe(catchError(getLogsFromArtifact));
return from(this.isWorkflowNodePendingOrRunning(workflow, nodeId)).pipe(
switchMap(isPendingOrRunning => {
if (!isPendingOrRunning && this.hasArtifactLogs(workflow, nodeId, container) && container === 'main') {
return getLogsFromArtifact();
}
return this.getContainerLogsFromCluster(workflow, podName, container, grep).pipe(catchError(getLogsFromArtifact));
})
);
}

public getArtifactLogsPath(workflow: Workflow, nodeId: string, container: string, archived: boolean) {
Expand Down

0 comments on commit 9d66b69

Please sign in to comment.