Skip to content

Commit

Permalink
fix(cli): Add retry to retry ;). Fixes argoproj#4101 (argoproj#4105)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Sep 23, 2020
1 parent ff195f2 commit c4d9102
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions workflow/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,19 @@ func RetryWorkflow(kubeClient kubernetes.Interface, hydrator hydrator.Interface,
default:
return nil, errors.Errorf(errors.CodeBadRequest, "workflow must be Failed/Error to retry")
}
var updated *wfv1.Workflow
err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
var err error
updated, err = retryWorkflow(kubeClient, hydrator, wfClient, wf, restartSuccessful, nodeFieldSelector)
return err == nil, err
})
if err != nil {
return nil, err
}
return updated, err
}

func retryWorkflow(kubeClient kubernetes.Interface, hydrator hydrator.Interface, wfClient v1alpha1.WorkflowInterface, wf *wfv1.Workflow, restartSuccessful bool, nodeFieldSelector string) (*wfv1.Workflow, error) {
err := hydrator.Hydrate(wf)
if err != nil {
return nil, err
Expand Down

0 comments on commit c4d9102

Please sign in to comment.