Skip to content

Commit d94c214

Browse files
shuangkunisubasinghe
authored andcommitted
fix: get logs from artifact when workflow deleted instead of archived. Fixes: #14083 (#14087)
Signed-off-by: shuangkun <[email protected]>
1 parent fd11401 commit d94c214

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ui/src/app/shared/services/workflows-service.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {EMPTY, from, Observable, of} from 'rxjs';
22
import {catchError, filter, map, mergeMap, switchMap} from 'rxjs/operators';
33
import * as models from '../../../models';
4-
import {Event, LogEntry, NodeStatus, Workflow, WorkflowList, WorkflowPhase} from '../../../models';
4+
import {Event, isWorkflowInCluster, LogEntry, NodeStatus, Workflow, WorkflowList, WorkflowPhase} from '../../../models';
55
import {ResubmitOpts, RetryOpts} from '../../../models';
66
import {SubmitOpts} from '../../../models/submit-opts';
77
import {uiUrl} from '../base';
@@ -253,9 +253,8 @@ export const WorkflowsService = {
253253
getContainerLogs(workflow: Workflow, podName: string, nodeId: string, container: string, grep: string, archived: boolean): Observable<LogEntry> {
254254
const getLogsFromArtifact = () => this.getContainerLogsFromArtifact(workflow, nodeId, container, grep, archived);
255255

256-
// If our workflow is archived, don't even bother inspecting the cluster for logs since it's likely
257-
// that the Workflow and associated pods have been deleted
258-
if (archived) {
256+
// If our workflow was deleted, try to get logs from artifacts.
257+
if (!isWorkflowInCluster(workflow)) {
259258
return getLogsFromArtifact();
260259
}
261260

0 commit comments

Comments
 (0)