From b0062e410de78f4e689eda66eaa5c6211aaf89a2 Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Thu, 19 Dec 2024 13:31:09 -0600 Subject: [PATCH] Pass CustomInfo metadata through ArrayNode ExternalResourceInfo (#591) (#6116) * Pass Actor metadata through ArrayNode ExternalResourceInfo (#591) * pass CustomInfo through ArrayNode event recorder Signed-off-by: Daniel Rammer * actually doing it Signed-off-by: Daniel Rammer * correctly passing custom Signed-off-by: Daniel Rammer --------- Signed-off-by: Daniel Rammer * events -> event Signed-off-by: Daniel Rammer * Run make -C flytepropelelr lint-fix Signed-off-by: Eduardo Apolinario --------- Signed-off-by: Daniel Rammer Signed-off-by: Eduardo Apolinario Co-authored-by: Eduardo Apolinario --- .../pkg/controller/nodes/array/event_recorder.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flytepropeller/pkg/controller/nodes/array/event_recorder.go b/flytepropeller/pkg/controller/nodes/array/event_recorder.go index 8d14bd1d43..d9feafe950 100644 --- a/flytepropeller/pkg/controller/nodes/array/event_recorder.go +++ b/flytepropeller/pkg/controller/nodes/array/event_recorder.go @@ -136,14 +136,21 @@ func (e *externalResourcesEventRecorder) process(ctx context.Context, nCtx inter log.Name = fmt.Sprintf("%s-%d", log.GetName(), index) } - e.externalResources = append(e.externalResources, &event.ExternalResourceInfo{ + externalResourceInfo := event.ExternalResourceInfo{ ExternalId: externalResourceID, Index: uint32(index), // #nosec G115 Logs: taskExecutionEvent.GetLogs(), RetryAttempt: retryAttempt, Phase: taskExecutionEvent.GetPhase(), CacheStatus: cacheStatus, - }) + CustomInfo: taskExecutionEvent.GetCustomInfo(), + } + + if taskExecutionEvent.GetMetadata() != nil && len(taskExecutionEvent.GetMetadata().GetExternalResources()) == 1 { + externalResourceInfo.CustomInfo = taskExecutionEvent.GetMetadata().GetExternalResources()[0].GetCustomInfo() + } + + e.externalResources = append(e.externalResources, &externalResourceInfo) } // clear nodeEvents and taskEvents