Skip to content

Commit

Permalink
feat: Set steps.*.ip to a json list if the node is an aggregate
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Melnick <[email protected]>
  • Loading branch information
meln5674 committed Sep 18, 2024
1 parent 889a9d2 commit c3baa65
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2842,7 +2842,6 @@ func (woc *wfOperationCtx) executeContainer(ctx context.Context, nodeName string
onExitPod: opts.onExitTemplate,
executionDeadline: opts.executionDeadline,
})

if err != nil {
return woc.requeueIfTransientErr(err, node.Name)
}
Expand Down Expand Up @@ -3198,6 +3197,7 @@ func (woc *wfOperationCtx) processAggregateNodeOutputs(scope *wfScope, prefix st
paramList := make([]map[string]string, 0)
outputParamValueLists := make(map[string][]string)
resultsList := make([]wfv1.Item, 0)
ipList := make([]string, 0)
for _, node := range childNodes {
if node.Outputs == nil || node.Phase != wfv1.NodeSucceeded || node.Type == wfv1.NodeTypeRetry {
continue
Expand All @@ -3221,6 +3221,9 @@ func (woc *wfOperationCtx) processAggregateNodeOutputs(scope *wfScope, prefix st
}
resultsList = append(resultsList, item)
}
if node.Daemoned != nil && *node.Daemoned {
ipList = append(ipList, node.PodIP)
}
}
{
resultsJSON, err := json.Marshal(resultsList)
Expand All @@ -3245,6 +3248,14 @@ func (woc *wfOperationCtx) processAggregateNodeOutputs(scope *wfScope, prefix st
}
scope.addParamToScope(key, valueListJson)
}
{
ipListJSON, err := json.Marshal(ipList)
if err != nil {
return err
}
key := fmt.Sprintf("%s.ip", prefix)
scope.addParamToScope(key, string(ipListJSON))
}
return nil
}

Expand Down

0 comments on commit c3baa65

Please sign in to comment.