From 9d1d2cd518628b2d4298b435386e82c7e7960f0d Mon Sep 17 00:00:00 2001 From: Tianchu Zhao Date: Fri, 6 Dec 2024 14:36:28 +1100 Subject: [PATCH] fix: cronOperator/serverResubmitWf retry create workflow on transient error. Fixes #13970 (#13971) 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 395928000c7a..d0ec8e5466d5 100644 --- a/workflow/util/util.go +++ b/workflow/util/util.go @@ -195,7 +195,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 } }