Skip to content

Commit

Permalink
fix: switch to wf.Status.Phase.Completed()
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 4, 2024
1 parent 35724ad commit 4db8ec8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cmd/argo/commands/common/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,7 @@ func waitOnOne(serviceClient workflowpkg.WorkflowServiceClient, ctx context.Cont
}
wf := event.Object

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 wf != nil && wf.Status.Phase.Completed() {
if !quiet {
fmt.Printf("%s %s at %v\n", wfName, wf.Status.Phase, wf.Status.FinishedAt)
}
Expand Down

0 comments on commit 4db8ec8

Please sign in to comment.