Skip to content

Commit

Permalink
meh
Browse files Browse the repository at this point in the history
Signed-off-by: Katrina Rogan <[email protected]>
  • Loading branch information
katrogan committed Jul 22, 2024
1 parent f398c50 commit 3f0d570
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion flyteadmin/pkg/manager/impl/util/single_task_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import (

const maxNodeIDLength = 63

var defaultRetryStrategy = core.RetryStrategy{
Retries: 3,
}

const systemNamePrefix = ".flytegen.%s"

const noInputNodeID = ""
Expand Down Expand Up @@ -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

Check warning on line 94 in flyteadmin/pkg/manager/impl/util/single_task_execution.go

View check run for this annotation

Codecov / codecov/patch

flyteadmin/pkg/manager/impl/util/single_task_execution.go#L94

Added line #L94 was not covered by tests
}

if err != nil {
if ferr, ok := err.(errors.FlyteAdminError); !ok || ferr.Code() != codes.NotFound {
return nil, err
Expand All @@ -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{
Expand Down

0 comments on commit 3f0d570

Please sign in to comment.