Skip to content

Commit

Permalink
(fix): Fix iterator to child metadata (#420)
Browse files Browse the repository at this point in the history
Signed-off-by: florian.cazals <[email protected]>
Co-authored-by: florian.cazals <[email protected]>
  • Loading branch information
floriancazals and florian.cazals authored Mar 1, 2023
1 parent 94fcdb2 commit dfcd3fa
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,17 @@ func contractStep(s *step.Step, res *resolution.Resolution) {
if child.Output != nil {
childM[values.OutputKey] = child.Output
}
var childMetadata map[string]interface{}
if child.Metadata != nil {
childM[values.MetadataKey] = child.Metadata
childMetadata, _ = child.Metadata.(map[string]interface{})
}
childMMetadata := childM[values.MetadataKey].(map[string]interface{})
if childMMetadata == nil {
childMMetadata = make(map[string]interface{})
if childMetadata == nil {
childMetadata = make(map[string]interface{})
}
childMMetadata[values.IteratorKey] = child.Item
childM[values.MetadataKey] = childMMetadata

childMetadata[values.IteratorKey] = make(map[string]interface{})
childMetadata[values.IteratorKey] = child.Item
childM[values.MetadataKey] = childMetadata
childM[values.StateKey] = child.State
var i interface{} = childM
collectedChildren = append(collectedChildren, i)
Expand Down

0 comments on commit dfcd3fa

Please sign in to comment.