Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): fallback to cluster logs when artifact logs not found. Fixes #12948 #13873

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading