From 0919980489836a6a312f6251e7c7ddc722dd637f Mon Sep 17 00:00:00 2001 From: Tianchu Zhao Date: Thu, 5 Dec 2024 13:59:17 +0000 Subject: [PATCH] fix: retry create workflow on transient error Signed-off-by: Tianchu Zhao --- workflow/util/util.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/workflow/util/util.go b/workflow/util/util.go index 7f1125c03f8ee..9e76960940184 100644 --- a/workflow/util/util.go +++ b/workflow/util/util.go @@ -193,7 +193,13 @@ func SubmitWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, wfClie } return wf, err } else { - return wfIf.Create(ctx, wf, metav1.CreateOptions{}) + var runWf *wfv1.Workflow + err = waitutil.Backoff(retry.DefaultRetry, func() (bool, error) { + var err error + runWf, err = wfIf.Create(ctx, wf, metav1.CreateOptions{}) + return !errorsutil.IsTransientErr(err), err + }) + return runWf, err } }