Skip to content

Commit

Permalink
Signed-off-by: tooptoop4 <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
tooptoop4 authored Nov 6, 2024
1 parent 4742e9d commit f9fd85b
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions ui/src/shared/services/workflows-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,21 +253,8 @@ export const WorkflowsService = {
const getLogsFromArtifact = () => this.getContainerLogsFromArtifact(workflow, nodeId, container, grep, archived);
const getLogsFromCluster = () => this.getContainerLogsFromCluster(workflow, podName, container, grep);

// If our workflow is archived, don't even bother inspecting the cluster for logs since it's likely
// that the Workflow and associated pods have been deleted
if (archived) {
return getLogsFromArtifact();
}

// return archived log if main container is finished and has artifact
return from(this.isWorkflowNodePendingOrRunning(workflow, nodeId)).pipe(
switchMap(isPendingOrRunning => {
if (!isPendingOrRunning && hasArtifactLogs(workflow, nodeId, container) && container === 'main') {
return getLogsFromArtifact().pipe(catchError(getLogsFromCluster));
}
return getLogsFromCluster().pipe(catchError(getLogsFromArtifact));
})
);
// Try artifact logs first, fall back to cluster logs if artifact logs are unavailable
return getLogsFromArtifact().pipe(catchError(getLogsFromCluster));
},

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

0 comments on commit f9fd85b

Please sign in to comment.