From 3f0d5708ca5c6b3ba044675724ac798a8427b02f Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Mon, 22 Jul 2024 19:59:59 +0200 Subject: [PATCH] meh Signed-off-by: Katrina Rogan --- .../manager/impl/util/single_task_execution.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/flyteadmin/pkg/manager/impl/util/single_task_execution.go b/flyteadmin/pkg/manager/impl/util/single_task_execution.go index 2f225b0dfd..b032d21e5f 100644 --- a/flyteadmin/pkg/manager/impl/util/single_task_execution.go +++ b/flyteadmin/pkg/manager/impl/util/single_task_execution.go @@ -22,6 +22,10 @@ import ( const maxNodeIDLength = 63 +var defaultRetryStrategy = core.RetryStrategy{ + Retries: 3, +} + const systemNamePrefix = ".flytegen.%s" const noInputNodeID = "" @@ -81,6 +85,15 @@ func CreateOrGetWorkflowModel( Version: workflowIdentifier.Version, }) + var retryStrategy *core.RetryStrategy + if task.GetClosure().GetCompiledTask().GetTemplate() != nil && + task.GetClosure().GetCompiledTask().GetTemplate().GetMetadata() != nil && + task.GetClosure().GetCompiledTask().GetTemplate().GetMetadata().GetRetries() != nil { + retryStrategy = task.GetClosure().GetCompiledTask().GetTemplate().GetMetadata().GetRetries() + } else { + retryStrategy = &defaultRetryStrategy + } + if err != nil { if ferr, ok := err.(errors.FlyteAdminError); !ok || ferr.Code() != codes.NotFound { return nil, err @@ -95,7 +108,7 @@ func CreateOrGetWorkflowModel( Id: generateNodeNameFromTask(taskIdentifier.Name), Metadata: &core.NodeMetadata{ Name: generateNodeNameFromTask(taskIdentifier.Name), - Retries: task.GetClosure().GetCompiledTask().GetTemplate().GetMetadata().GetRetries(), + Retries: retryStrategy, }, Inputs: generateBindings(*task.Closure.CompiledTask.Template.Interface.Inputs, noInputNodeID), Target: &core.Node_TaskNode{