Skip to content

Commit

Permalink
fix: make archived logs more human friendly in UI (argoproj#11420)
Browse files Browse the repository at this point in the history
Signed-off-by: Isitha Subasinghe <isubasinghe@student.unimelb.edu.au>
  • Loading branch information
toyamagu-2021 authored and isubasinghe committed May 5, 2024
1 parent 660bbb6 commit b23713e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ui/src/app/shared/services/workflows-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,20 @@ export class WorkflowsService {
return this.isNodePendingOrRunning(node);
}

public getContainerLogsFromArtifact(workflow: Workflow, nodeId: string, container: string, grep: string, archived: boolean) {
getContainerLogsFromArtifact(workflow: Workflow, nodeId: string, container: string, grep: string, archived: boolean): Observable<LogEntry> {
return of(this.hasArtifactLogs(workflow, nodeId, container)).pipe(
switchMap(hasArtifactLogs => {
if (!hasArtifactLogs) {
switchMap(isArtifactLogs => {
if (!isArtifactLogs) {
if (!nodeId) {
throw new Error('Should specify a node when we get archived logs');
}
throw new Error('no artifact logs are available');
}

return from(requests.get(this.getArtifactLogsPath(workflow, nodeId, container, archived)));
}),
mergeMap(r => r.text.split('\n')),
map(content => ({content} as LogEntry)),
map(content => ({content, podName: workflow.status.nodes[nodeId].displayName} as LogEntry)),
filter(x => !!x.content.match(grep))
);
}
Expand Down

0 comments on commit b23713e

Please sign in to comment.