MCPcopy
hub / github.com/argoproj/argo-workflows / addChildNode

Method addChildNode

workflow/controller/operator.go:3709–3723  ·  view source on GitHub ↗

addChildNode adds a nodeID as a child to a parent parent and child are both node names

(ctx context.Context, parent string, child string)

Source from the content-addressed store, hash-verified

3707// addChildNode adds a nodeID as a child to a parent
3708// parent and child are both node names
3709func (woc *wfOperationCtx) addChildNode(ctx context.Context, parent string, child string) {
3710 parentID := woc.wf.NodeID(parent)
3711 childID := woc.wf.NodeID(child)
3712 node, err := woc.wf.Status.Nodes.Get(parentID)
3713 if err != nil {
3714 woc.log.WithPanic().WithField("nodeID", parentID).Error(ctx, "was unable to obtain node for nodeID")
3715 }
3716 if slices.Contains(node.Children, childID) {
3717 // already exists
3718 return
3719 }
3720 node.Children = append(node.Children, childID)
3721 woc.wf.Status.Nodes.Set(ctx, parentID, *node)
3722 woc.updated = true
3723}
3724
3725// executeResource is runs a kubectl command against a manifest
3726func (woc *wfOperationCtx) executeResource(ctx context.Context, nodeName string, templateScope string, tmpl *wfv1.Template, orgTmpl wfv1.TemplateReferenceHolder, opts *executeTemplateOpts) (*wfv1.NodeStatus, error) {

Callers 15

executeContainerSetMethod · 0.95
executeDAGTaskMethod · 0.95
executeTemplateMethod · 0.95
runOnExitNodeMethod · 0.95
executeStepsMethod · 0.95
executeStepGroupMethod · 0.95
expandStepGroupMethod · 0.95
TestProcessNodeRetriesFunction · 0.80

Calls 6

NodeIDMethod · 0.80
GetMethod · 0.65
ErrorMethod · 0.65
WithFieldMethod · 0.65
WithPanicMethod · 0.65
SetMethod · 0.45