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 (argoproj#9540)

Signed-off-by: juchao <[email protected]>
  • Loading branch information
juliev0 authored and juchaosong committed Nov 3, 2022
1 parent 4ab5a03 commit 701b67b
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 701b67b

Please sign in to comment.