From 7644f14a1e031e8562c13d5ff0445fea0d77ebeb Mon Sep 17 00:00:00 2001 From: Isitha Subasinghe Date: Tue, 25 Oct 2022 10:54:20 +1100 Subject: [PATCH] fix: default initialisation markNodePhase Signed-off-by: Isitha Subasinghe --- workflow/controller/operator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index 933b9db9f433..a07476bce51f 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -2309,7 +2309,8 @@ func (woc *wfOperationCtx) initializeNode(nodeName string, nodeType wfv1.NodeTyp func (woc *wfOperationCtx) markNodePhase(nodeName string, phase wfv1.NodePhase, message ...string) *wfv1.NodeStatus { node := woc.wf.GetNodeByName(nodeName) if node == nil { - panic(fmt.Sprintf("workflow '%s' node '%s' uninitialized when marking as %v: %s", woc.wf.Name, nodeName, phase, message)) + woc.log.Warningf("workflow '%s' node '%s' uninitialized when marking as %v: %s", woc.wf.Name, nodeName, phase, message) + node = &wfv1.NodeStatus{} } if node.Phase != phase { if node.Phase.Fulfilled() {