Skip to content

Commit

Permalink
fix: Correctly retry an archived wf even when it exists in the cluster.
Browse files Browse the repository at this point in the history
Fixes #11903 (#11906)

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan committed Sep 30, 2023
1 parent 498f011 commit e91c273
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ui/src/app/workflows/components/retry-workflow-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {Utils} from '../../shared/utils';
interface Props {
workflow: Workflow;
isArchived: boolean;
isWorkflowInCluster: boolean;
}

export function RetryWorkflowPanel(props: Props) {
Expand All @@ -32,9 +33,10 @@ export function RetryWorkflowPanel(props: Props) {
};

try {
const submitted = props.isArchived
? await services.workflows.retryArchived(props.workflow.metadata.uid, props.workflow.metadata.namespace, opts)
: await services.workflows.retry(props.workflow.metadata.name, props.workflow.metadata.namespace, opts);
const submitted =
props.isArchived && !props.isWorkflowInCluster
? await services.workflows.retryArchived(props.workflow.metadata.uid, props.workflow.metadata.namespace, opts)
: await services.workflows.retry(props.workflow.metadata.name, props.workflow.metadata.namespace, opts);
document.location.href = uiUrl(`workflows/${submitted.metadata.namespace}/${submitted.metadata.name}`);
} catch (err) {
setError(err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,9 @@ export function WorkflowDetails({history, location, match}: RouteComponentProps<
{parsedSidePanel.type === 'share' && <WidgetGallery namespace={namespace} name={name} />}
{parsedSidePanel.type === 'yaml' && <WorkflowYamlViewer workflow={workflow} selectedNode={selectedNode} />}
{parsedSidePanel.type === 'resubmit' && <ResubmitWorkflowPanel workflow={workflow} isArchived={isArchivedWorkflow(workflow)} />}
{parsedSidePanel.type === 'retry' && <RetryWorkflowPanel workflow={workflow} isArchived={isArchivedWorkflow(workflow)} />}
{parsedSidePanel.type === 'retry' && (
<RetryWorkflowPanel workflow={workflow} isArchived={isArchivedWorkflow(workflow)} isWorkflowInCluster={isWorkflowInCluster(workflow)} />
)}
{!parsedSidePanel}
</SlidingPanel>
)}
Expand Down

0 comments on commit e91c273

Please sign in to comment.