From f9fd85b544f9f7f760ff23b5a565c905850d887a Mon Sep 17 00:00:00 2001 From: tooptoop4 <33283496+tooptoop4@users.noreply.github.com> Date: Thu, 7 Nov 2024 06:05:47 +1100 Subject: [PATCH] Signed-off-by: tooptoop4 <33283496+tooptoop4@users.noreply.github.com> --- ui/src/shared/services/workflows-service.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/ui/src/shared/services/workflows-service.ts b/ui/src/shared/services/workflows-service.ts index e78df30f2f72..b44793a44885 100644 --- a/ui/src/shared/services/workflows-service.ts +++ b/ui/src/shared/services/workflows-service.ts @@ -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) {