Skip to content

Commit

Permalink
fix: wait inifinite wait if finishedAt not set
Browse files Browse the repository at this point in the history
Signed-off-by: Ilia Medvedev <[email protected]>
  • Loading branch information
ilia-medvedev-codefresh committed Sep 2, 2024
1 parent 86fedbd commit 35724ad
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/argo/commands/common/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,16 @@ func waitOnOne(serviceClient workflowpkg.WorkflowServiceClient, ctx context.Cont
continue
}
wf := event.Object
if wf != nil && !wf.Status.FinishedAt.IsZero() {

isWorkflowInTerminalState := func(wf *wfv1.Workflow) bool {
if !wf.Status.FinishedAt.IsZero() {
return true
} else {
return wf.Status.Phase == wfv1.WorkflowFailed || wf.Status.Phase == wfv1.WorkflowError || wf.Status.Phase == wfv1.WorkflowSucceeded
}
}

if wf != nil && isWorkflowInTerminalState(wf) {
if !quiet {
fmt.Printf("%s %s at %v\n", wfName, wf.Status.Phase, wf.Status.FinishedAt)
}
Expand Down

0 comments on commit 35724ad

Please sign in to comment.