addChildNode adds a nodeID as a child to a parent parent and child are both node names
(ctx context.Context, parent string, child string)
| 3707 | // addChildNode adds a nodeID as a child to a parent |
| 3708 | // parent and child are both node names |
| 3709 | func (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 |
| 3726 | func (woc *wfOperationCtx) executeResource(ctx context.Context, nodeName string, templateScope string, tmpl *wfv1.Template, orgTmpl wfv1.TemplateReferenceHolder, opts *executeTemplateOpts) (*wfv1.NodeStatus, error) { |