From 4db8ec80ab14944c84e4f0c217a16d88b39a5068 Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Wed, 4 Sep 2024 09:32:28 +0300 Subject: [PATCH] fix: switch to wf.Status.Phase.Completed() Signed-off-by: Ilia Medvedev --- cmd/argo/commands/common/wait.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmd/argo/commands/common/wait.go b/cmd/argo/commands/common/wait.go index 589bdae9fcdc..0f6fe446c57e 100644 --- a/cmd/argo/commands/common/wait.go +++ b/cmd/argo/commands/common/wait.go @@ -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) }