@@ -207,6 +207,7 @@ func (w *Workflow) GenerateRetryExecution() (ExecutionSpec, []string, error) {
207
207
delete (newWF .Labels , LabelKeyWorkflowPersistedFinalState )
208
208
newWF .ObjectMeta .Labels [common .LabelKeyPhase ] = string (workflowapi .NodeRunning )
209
209
newWF .Status .Phase = workflowapi .WorkflowRunning
210
+ newWF .Status .Conditions .UpsertCondition (workflowapi.Condition {Status : metav1 .ConditionFalse , Type : workflowapi .ConditionTypeCompleted })
210
211
newWF .Status .Message = ""
211
212
newWF .Status .FinishedAt = metav1.Time {}
212
213
if newWF .Spec .ActiveDeadlineSeconds != nil && * newWF .Spec .ActiveDeadlineSeconds == 0 {
@@ -223,8 +224,7 @@ func (w *Workflow) GenerateRetryExecution() (ExecutionSpec, []string, error) {
223
224
switch node .Phase {
224
225
case workflowapi .NodeSucceeded , workflowapi .NodeSkipped :
225
226
if ! strings .HasPrefix (node .Name , onExitNodeName ) {
226
- nodeName := RetrievePodName (* newWF , node )
227
- newWF .Status .Nodes [nodeName ] = node
227
+ newWF .Status .Nodes [node .ID ] = node
228
228
continue
229
229
}
230
230
case workflowapi .NodeError , workflowapi .NodeFailed , workflowapi .NodeOmitted :
@@ -233,8 +233,7 @@ func (w *Workflow) GenerateRetryExecution() (ExecutionSpec, []string, error) {
233
233
newNode .Phase = workflowapi .NodeRunning
234
234
newNode .Message = ""
235
235
newNode .FinishedAt = metav1.Time {}
236
- nodeName := RetrievePodName (* newWF , * newNode )
237
- newWF .Status .Nodes [nodeName ] = * newNode
236
+ newWF .Status .Nodes [node .ID ] = * newNode
238
237
continue
239
238
}
240
239
// do not add this status to the node. pretend as if this node never existed.
@@ -248,6 +247,23 @@ func (w *Workflow) GenerateRetryExecution() (ExecutionSpec, []string, error) {
248
247
podsToDelete = append (podsToDelete , oldNodeID )
249
248
}
250
249
}
250
+ for _ , node := range newWF .Status .Nodes {
251
+ var children []string
252
+ for _ , child := range node .Children {
253
+ if _ , ok := newWF .Status .Nodes [child ]; ok {
254
+ children = append (children , child )
255
+ }
256
+ }
257
+ var outboundNodes []string
258
+ for _ , outboundNode := range node .OutboundNodes {
259
+ if _ , ok := newWF .Status .Nodes [outboundNode ]; ok {
260
+ outboundNodes = append (outboundNodes , outboundNode )
261
+ }
262
+ }
263
+ node .Children = children
264
+ node .OutboundNodes = outboundNodes
265
+ newWF .Status .Nodes [node .ID ] = node
266
+ }
251
267
return NewWorkflow (newWF ), podsToDelete , nil
252
268
}
253
269
0 commit comments