From 01d4bec672142980b7798d85065c59b3664b7882 Mon Sep 17 00:00:00 2001 From: Mecoli1219 Date: Fri, 10 Jan 2025 13:26:34 -0800 Subject: [PATCH] fix offload error Signed-off-by: Mecoli1219 --- .../pkg/controller/nodes/array/handler.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flytepropeller/pkg/controller/nodes/array/handler.go b/flytepropeller/pkg/controller/nodes/array/handler.go index 6418c35270..436a0e6422 100644 --- a/flytepropeller/pkg/controller/nodes/array/handler.go +++ b/flytepropeller/pkg/controller/nodes/array/handler.go @@ -470,7 +470,6 @@ func (a *arrayNodeHandler) Handle(ctx context.Context, nCtx interfaces.NodeExecu )), nil case v1alpha1.ArrayNodePhaseSucceeding: gatherOutputsRequests := make([]*gatherOutputsRequest, 0, len(arrayNodeState.SubNodePhases.GetItems())) - outputLiteralTypes := make(map[string]*idlcore.LiteralType) for i, nodePhaseUint64 := range arrayNodeState.SubNodePhases.GetItems() { nodePhase := v1alpha1.NodePhase(nodePhaseUint64) // #nosec G115 gatherOutputsRequest := &gatherOutputsRequest{ @@ -497,12 +496,6 @@ func (a *arrayNodeHandler) Handle(ctx context.Context, nCtx interfaces.NodeExecu if task.CoreTask() != nil && task.CoreTask().GetInterface() != nil && task.CoreTask().GetInterface().GetOutputs() != nil { for name := range task.CoreTask().GetInterface().GetOutputs().GetVariables() { outputLiterals[name] = nilLiteral - // Extract the literal type from the task interface - outputLiteralTypes[name] = &idlcore.LiteralType{ - Type: &idlcore.LiteralType_CollectionType{ - CollectionType: task.CoreTask().GetInterface().GetOutputs().GetVariables()[name].GetType(), - }, - } } } @@ -538,6 +531,7 @@ func (a *arrayNodeHandler) Handle(ctx context.Context, nCtx interfaces.NodeExecu // attempt best effort at initializing outputLiterals with output variable names. currently // only TaskNode and WorkflowNode contain node interfaces. outputLiterals := make(map[string]*idlcore.Literal) + outputLiteralTypes := make(map[string]*idlcore.LiteralType) switch arrayNode.GetSubNodeSpec().GetKind() { case v1alpha1.NodeKindTask: taskID := *arrayNode.GetSubNodeSpec().TaskRef @@ -558,6 +552,12 @@ func (a *arrayNodeHandler) Handle(ctx context.Context, nCtx interfaces.NodeExecu } outputLiterals[name] = outputLiteral + // Extract the literal type from the task interface + outputLiteralTypes[name] = &idlcore.LiteralType{ + Type: &idlcore.LiteralType_CollectionType{ + CollectionType: outputs.GetVariables()[name].GetType(), + }, + } } } case v1alpha1.NodeKindWorkflow: